Set CustomActionData on a ClickOnce setup.exe

你说的曾经没有我的故事 提交于 2020-01-14 04:34:08

问题


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.

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?

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

Thanks in advance.


回答1:


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.

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



来源:https://stackoverflow.com/questions/6173553/set-customactiondata-on-a-clickonce-setup-exe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!