Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wix 作为安装的一部分,将MSI复制到目录中_Wix_Windows Installer - Fatal编程技术网

Wix 作为安装的一部分,将MSI复制到目录中

Wix 作为安装的一部分,将MSI复制到目录中,wix,windows-installer,Wix,Windows Installer,我正在使用WiX的最新版本来构建我的安装程序项目,需要解决我的问题 当我安装ProductA.msi时,我希望ProductA.msi将其自身复制到一个目录中,称之为%PROGRAMFILES%\ProductA\Installer-以便我使用的安装程序可在%PROGRAMFILES%\ProductA\Installer\ProductA.msi重复使用 有人知道这是否可行吗?我不确定你喜欢做什么是否合适 但是: 您可以使用robocopy编写一个.bat文件,将msi及其文件复制到目标,然后

我正在使用WiX的最新版本来构建我的安装程序项目,需要解决我的问题

当我安装ProductA.msi时,我希望ProductA.msi将其自身复制到一个目录中,称之为%PROGRAMFILES%\ProductA\Installer-以便我使用的安装程序可在%PROGRAMFILES%\ProductA\Installer\ProductA.msi重复使用


有人知道这是否可行吗?

我不确定你喜欢做什么是否合适

但是:
您可以使用robocopy编写一个.bat文件,将msi及其文件复制到目标,然后启动.msi。

我需要做同样的事情,最后作为自定义操作在powershell脚本中抛出。WiX具有指向正在运行的.msi的[OriginalDatabase]属性。我只是把它作为一个参数传递给一个快速脚本,它就可以工作了

param(
[string]$MsiLocation
)

echo "Creating directory"
md -Force "C:\directory"

echo "Removing current files"
rm "C:\directory\*"

echo "Copying in new .msi"
cp "$MsiLocation" "C:\directory\"

这并不优雅,但它完成了任务。您可以查看更多详细信息。

您知道msiexec已经缓存了安装程序,是吗?Windows Installer通常会在%windir%\Installer中保存所有安装程序的副本。有关查找安装程序的信息,请参阅上的答案。@sttaq-不需要查找安装程序-这是
msiexec
接受程序包ID作为
.msi
路径的替代路径的原因。不确定为什么会被否决。。。感谢您的回答-我需要能够访问安装程序,以便远程连接客户端可以获得安装内容的副本。@Damien_不信者感谢您指出这一点。