如何从Wix安装程序中的命令行参数定义安装文件夹 [英] How to define installation folder from command line parameter in Wix installer

查看:126
本文介绍了如何从Wix安装程序中的命令行参数定义安装文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下wxs代码将应用程序安装到特定文件夹:

I install my application to a specific folder using the below wxs code:

<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLDIR" Name="CompanyName">
                <Directory Id="SUBDIR" Name="Application Launcher">
                    <Component Id="ApplicationFiles" Guid="*">
                        <File Name="app.exe" Id="AppFile1" Source="app.exe" Vital="yes" />
                    </Component>
                </Directory>
            </Directory>
        </Directory>
</Directory>

我想用以下命令从命令行中指定一个参数来指定安装文件夹:

I want to specify the installation folder with a parameter to be given from the command line like below:

msiexec.exe /i setup.msi PATH=C:\MyCompany\Folder\ /qn

非常感谢.

推荐答案

<Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="CompanyFolder" Name="CompanyName">
                <Directory Id="INSTALLLOCATION" Name="Application Launcher">
                    <Component Id="ApplicationFiles" Guid="*">
                        <File Name="app.exe" Id="AppFile1" Source="app.exe" Vital="yes" />
                    </Component>
                </Directory>
            </Directory>
        </Directory>
</Directory>

对于您的安装:

msiexec /I setup.msi INSTALLLOCATION=C:\Somewhere /qn

这篇关于如何从Wix安装程序中的命令行参数定义安装文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆