简体   繁体   English

在Visual Studio安装项目中从自定义操作设置应用程序文件夹

[英]Set Application Folder from Custom Action in Visual Studio Setup project

My Visual Studio 2008 Setup Project must choose the install directory automatically based on a configuration file. 我的Visual Studio 2008安装项目必须根据配置文件自动选择安装目录。 I'm using a C# class derived from Installer for the custom action. 我正在使用从Installer派生的C#类进行自定义操作。 I read the config file in my Install() method. 我在Install()方法中读取了配置文件。

How do I change the installer's Application Folder from within this custom action? 如何从此自定义操作中更改安装程序的应用程序文件夹?

The installation folder path is stored in TARGETDIR property. 安装文件夹路径存储在TARGETDIR属性中。

Installer class actions cannot set Windows Installer properties, so you cannot use your current custom action to dynamically change the installation path. 安装程序类操作无法设置Windows Installer属性,因此您无法使用当前的自定义操作来动态更改安装路径。

Only the following custom action types can set installer properties: 只有以下自定义操作类型可以设置安装程序属性:

  • win32 DLL which receives the installation handle win32 DLL接收安装句柄
  • VBScript and Java Script VBScript和Java脚本
  • WiX toolset custom action WiX工具集自定义操作

If you use one of them, you can set the TARGETDIR property to any path you need. 如果您使用其中一个,则可以将TARGETDIR属性设置为您需要的任何路径。

if this is a regular application you can also look at changing and or adding things here check out the screen shot 如果这是一个常规应用程序,您还可以查看更改和/或添加内容,请查看屏幕截图 在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio安装程序安装项目从自定义操作执行回滚 - Visual studio installer setup project perform rollback from custom action 在Visual Studio 2017安装项目中为卸载添加自定义操作 - Add a custom action on uninstall in Visual Studio 2017 setup project 用于“安装和部署Visual Studio”的自定义安装项目-如何获取.msi文件所在的文件夹的内容? - Custom setup project for “Setup and Deployment Visual Studio”- How to get the contents of the folder where the .msi file resides? Visual Studio安装程序项目向导自定义 - Visual Studio Setup Project Wizard Custom VS2015 Visual Studio Insaller=>设置项目添加自定义操作 - VS2015 Visual Studio Insaller=>Setup Project add custom action Visual Studio安装程序,用于复制安装文件的自定义操作 - Visual Studio Setup, Custom Action to copy the setup file 如何在Visual Studio安装项目中使用自定义窗体来自定义安装向导 - How to customize the Setup wizard with custom forms in Visual Studio setup project Visual Studio安装项目 - Visual Studio Setup Project Visual Studio安装项目以目标Public Documents文件夹 - Visual Studio Setup Project to target Public Documents folder 无法在 Visual Studio 17 中运行使用安装项目安装的应用程序 - Cannot run application installed using Setup Project in Visual Studio 17
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM