且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从安装部署项目目录

更新时间:2023-11-28 16:37:34

看看在安装类。添加从这个类派生你的应用程序的项目一个新的类。不要忘了应用runInstaller的属性。

Take a look at the Installer class. Add a new class derived from this class to your application's project. Don't forget to apply the RunInstaller attribute.

在部署项目中,添加自定义操作安装并提交。对于CustomActionData属性为安装自定义操作,输入 / TARGETDIR =[TARGETDIR] \

In your deployment project, add a Custom Action for Install and Commit. For the CustomActionData property for the Install custom action, enter /Targetdir="[TARGETDIR]\".

在您在应用程序的项目创建了安装程序类,覆盖安装方法,在这种方法,你可以得到这样的安装目录:

In your Installer class that you created in the application's project, override the Install method, and in this method you can get the installation directory like this:

string targetDir = Context.Parameters[ "TargetDir" ];