问题
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