Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.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_Custom Action - Fatal编程技术网

WiX自定义操作-MSI复制本身

WiX自定义操作-MSI复制本身,wix,custom-action,Wix,Custom Action,有人能帮我在MSI中建立一个自定义操作,它将在成功安装到某个X位置后复制自身。 我已经看到它可以使用.exe来完成,但我只想使用CA.DLL(C#)来完成,因为这个exe将是一个开销。下面是一个示例VB脚本,它将按名称查找已安装的产品并复制MSI的缓存副本。这将在Windows7和更高版本上工作,因为完整的MSI被缓存,任何嵌入的cab文件都保留在MSI中。您只需要在旧系统上获得MSI,而不需要有效负载 Dim安装程序、产品、产品、产品代码 Set installer=Wscript.Creat

有人能帮我在MSI中建立一个自定义操作,它将在成功安装到某个X位置后复制自身。
我已经看到它可以使用.exe来完成,但我只想使用CA.DLL(C#)来完成,因为这个exe将是一个开销。

下面是一个示例VB脚本,它将按名称查找已安装的产品并复制MSI的缓存副本。这将在Windows7和更高版本上工作,因为完整的MSI被缓存,任何嵌入的cab文件都保留在MSI中。您只需要在旧系统上获得MSI,而不需要有效负载

Dim安装程序、产品、产品、产品代码
Set installer=Wscript.CreateObject(“WindowsInstaller.installer”)
对于installer.Products中的每个productCode
如果InStr(1,LCase(installer.ProductInfo(productCode,“ProductName”))、LCase(“我的产品名称”),则退出以获取
下一个
如果为空(productCode),则Wscript.Quit 2
Set products=installer.ProductsEx(productCode,“,7)
filesys.copyFile产品(0).InstallProperty(“LocalPackage”),“c:\path\to\newcopy.msi”