在ClickOnce setup.exe上设置CustomActionData [英] Set CustomActionData on a ClickOnce setup.exe

查看:78
本文介绍了在ClickOnce setup.exe上设置CustomActionData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要发布我的应用程序(ClickOnce),以便人们可以从网络上安装我的应用程序。使用ClickOnce,会自动创建setup.exe文件。我在应用程序中所做的是添加一个 Visual Studio安装项目(我将其命名为AppSetup),然后在安装文件夹中进行了重要的自定义操作。

I need to do a Publish of my application (ClickOnce) so people can install my application from the web. With ClickOnce the setup.exe file is automatically created. What I have done in my application is to add a "Visual Studio Setup project" (which I named AppSetup) and there I have made an important Custom Action in the Install folder.

如何让ClickOnce基于AppSetup创建setup.exe,而不是自动创建默认的setup.exe?如果无法做到这一点,那么在发布应用程序之前,如何在setup.exe(由ClickOnce自动创建)上执行自定义操作?

How can I make ClickOnce create the setup.exe based on AppSetup instead of creating a default setup.exe automatically? If this is not possible, how can I make Custom Actions on the setup.exe (that ClickOnce creates automatically) before I publish my application?

简而言之:是否有一个使自动创建的setup.exe(使用ClickOnce)具有CustomActionData的方法?

In short: is there a way to make the automatically created setup.exe (with ClickOnce) have a CustomActionData?

预先感谢。

推荐答案

尽管您无法自定义必备的安装过程,但是可以创建另一个.Net应用程序,该应用程序执行您要在安装应用程序之前执行的所有自定义工作。制作了预安装应用程序之后,创建并编译安装项目,为预安装应用程序生成引导程序,并将预安装应用程序添加到Visual Studio的可用必备组件列表中。

Although you cannot customize the prerequisite installation process, you could create another .Net application that does all of the custom work that you would want to execute before the installation of your application. After making the pre-install application, create and compile an installation project, generate a bootstrapper for the pre-install application and add the pre-install application to your list of available prerequisites for Visual Studio.

在您的应用程序项目中,转到属性->发布->先决条件,然后单击您创建的安装前必备条件的选项。

In your application project, go Properties -> Publish -> Prerequisites and click the option for your pre-install perquisite that you created.

如果用户尝试安装您的应用程序,则ClickOnce setup.exe文件将在安装最终应用程序之前启动执行您的自定义操作的应用程序。

When a user attempts to install your application, the ClickOnce setup.exe file will launch the application that executes your "custom actions" before the final application is installed.

有关创建先决条件的更多信息,请转到此处:

For further information regarding creating your own prerequisites, go here:

http://msdn.microsoft.com /en-us/library/ms165429(v=vs.80).aspx

这篇关于在ClickOnce setup.exe上设置CustomActionData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆