简体   繁体   English

在Visual Studio安装程序中更改安装路径(应用程序文件夹)

[英]Changing the Installation Path (Application Folder) in Visual studio installer

I want to add a dialog which will be a Text-box, user will write something in that (like client Name - Nike) which will mandatory to fill and then i want to use that value in Application Folder . 我想添加一个对话框,该对话框将是一个文本框,用户将在其中写一些内容(例如客户端名称-Nike),这将强制填写,然后我想在Application Folder中使用该值。 Ex - default Application Folder path is - [ProgramFilesFolder][Manufacturer]\\[ProductName] and i want to add this textbox or dialog value in that means now folder location will be [ProgramFilesFolder][Manufacturer]\\[TextBoxValue]\\[ProductName] . 例如,默认的“应用程序文件夹”路径为- [ProgramFilesFolder][Manufacturer]\\[ProductName] ,我想添加此文本框或对话框值,这意味着现在文件夹位置将为[ProgramFilesFolder][Manufacturer]\\[TextBoxValue]\\[ProductName] Please help me if i can write this code in class or how to add in property? 如果我可以在课堂上编写此代码或如何添加属性,请帮助我? Can i achieve it? 我能做到吗? Please reply. 请回复。 Thanks for helping... 感谢您的帮助...

Default Location Image 默认位置图片

在此处输入图片说明

Added a textbox in user interface which is - 在用户界面中添加了一个textbox -

在此处输入图片说明

There is no support for doing this in Visual Studio setup projects. 在Visual Studio安装项目中不支持这样做。 However it can be achieved by altering the MSI file after it's been built. 但是,可以通过在生成MSI文件后更改它来实现。

In the textboxes dialog with a default property name EDITA1, the normal way to add the user entered value to the path would be to define the path in the File System view for the Application Folder as: 在具有默认属性名称EDITA1的文本框对话框中,将用户输入的值添加到路径的通常方法是在“应用程序文件夹”的“文件系统”视图中定义路径为:

[ProgramFiles64Folder][Manufacturer]\\NewSetup[EDITA1] [ProgramFiles64Folder] [生产] \\ NewSetup [EDITA1]

where the brackets around property names cause them to resolve to the actual values. 属性名称周围的方括号使它们解析为实际值。 So basically put [EDITA1] in the appropriate place. 因此,基本上将[EDITA1]放在适当的位置。

Unfortunately Visual Studio's generation of the MSI file breaks this. 不幸的是,Visual Studio生成的MSI文件打破了这一点。 The issue is that the directory for the application folder is set BEFORE the textboxes dialog is shown. 问题是在显示文本框对话框之前,已设置了应用程序文件夹的目录。 The way to fix this is to edit the MSI file with Orca, and change the InstallUISequence table at the end. 解决此问题的方法是使用Orca编辑MSI文件,并在最后更改InstallUISequence表。 The sequence number values don't matter. 序列号值无关紧要。 Just alter the sequence numbers so that end of the InstallUISequence table is in the order: 只需更改序列号,以使InstallUISequence表的结尾按顺序排列即可:

MaintenanceForm DIRCA_TARGETDIR CostFinalize FolderForm ExecuteAction MaintenanceForm DIRCA_TARGETDIR CostFinalize FolderForm ExecuteAction

and be sure that you have moved DIRCA_TARGETDIR and not left it in its early position. 并确保您已移动DIRCA_TARGETDIR并将其放置在其早期位置。

DIRCA_TARGETDIR is the action that sets the target directory for the application folder. DIRCA_TARGETDIR是为应用程序文件夹设置目标目录的操作。 By placing it after the textboxes dialog it will include the value of EDITA1, which is what is shown in FolderForm for the install directory for Application Folder. 通过将其放在文本框对话框之后,它将包含EDITA1的值,该值在FolderForm中显示为Application Folder的安装目录。

暂无
暂无

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

相关问题 安装程序C#Visual Studio 2010中的文件夹路径输入 - folder path input in installer c# visual studio 2010 Visual Studio Installer用于设置脚本文件的路径 - Visual Studio Installer with to set path of script file 以编程方式设置Visual Studio安装程序的路径 - Set path of a visual studio installer programatically 如何从Visual Studio 2012获取已安装应用程序的文件夹路径 - How to get folder path of Installed application, from Visual Studio 2012 在安装过程中使用 Visual Studio 安装程序更改 app.configuration 文件失败:无法加载文件或程序集“EntityFramework” - Changing app.configuration file during installation process with visual studio installer fails: Could not load file or assembly 'EntityFramework' Wix 安装程序:更改现有应用程序的安装路径不起作用 - Wix Installer: Changing the installation path for an existing app does nothing 使用“ Visual Studio安装程序”创建的安装程序安装后,应用程序未打开 - Application is not getting opened after installing it with the installer created by “Visual studio installer” Visual Studio 文件夹文件路径 - Visual Studio Folder file path 安装前运行自定义操作 - Visual Studio 安装程序 - Running Custom Action before installation - Visual studio installer 在Visual Studio中创建自定义安装程序,以允许单独安装客户端和服务器 - Creating Custom installer in visual studio that allows separate installation for Client and Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM