简体   繁体   English

使用ProductVersion安装Shield msiexec INSTALLDIR

[英]Install Shield msiexec INSTALLDIR with ProductVersion

Is it possible for me to use MsiExec and set the install directory with the ProductVersion property as part of the path? 我可以使用MsiExec并使用ProductVersion属性将安装目录设置为路径的一部分吗?

msiexec /i C:\\myapp.msi INSTALLDIR=C:\\MyApp\\[ProductVersion] msiexec / i C:\\ myapp.msi INSTALLDIR = C:\\ MyApp \\ [ProductVersion]

You can't use a property on the command line like that. 您不能在命令行上使用这样的属性。 If [ProductVersion] is used in the directory table or to build up INSTALLDIR as part of the MSI, that would work fine. 如果在目录表中使用[ProductVersion]或将INSTALLDIR建立为MSI的一部分,则可以正常工作。 However, MSI properties have no meaning to the command interpeter. 但是,MSI属性对命令干预没有任何意义。

You can set properties on the commandline like 您可以在命令行上设置属性,例如

msiexec /i PROPERTY=VALUE A:\Example.msi

(from: http://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx ) (摘自: http : //msdn.microsoft.com/zh-cn/library/windows/desktop/aa367988 ( v=vs.85 ) .aspx

You would need a script to query the MSI's Property table to obtain the ProductVersion and then use that to build your command line. 您将需要一个脚本来查询MSI的“属性”表以获得ProductVersion,然后使用该脚本来构建命令行。

If this is your install and this is your desired behavior, then you'd be better off authoring a custom action to mutate the INSTALLDIR automatically. 如果这是您的安装,并且是您所希望的行为,那么最好编写一个自定义操作以自动更改INSTALLDIR。 If this is not your install and this is just how you like to install the product then ServerFault is a better place to ask this. 如果这不是您的安装,而这仅仅是您要安装产品的方式,那么ServerFault是一个更好的选择。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM