Wix安装程序不会覆盖以前版本的可执行文件
我有一个非常简单的安装程序 – 将一个DLL复制到Program Files子文件夹并使用regsvr32.exe注册它.效果很好,但是如果安装了旧版本的dll,“修复”不会覆盖现有的dll. dll已签名,其版本(版本)编号始终递增(例如2.0.0.123 – > 2.0.0.124).
查看以前的类似帖子,我添加了RemoveExistingProducts并将ProductId指定为“*”.卸载然后安装新版本工作正常,但我真的需要修复来更新现有的DLL. 还有什么我需要做的吗? 谢谢! <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <!-- When creating a new install for the next version,these fields must be modified --> <?define ProductVersion = "2.0.00" ?> <?define ProductId64 = "*" ?> <?define ProductId32 = "*" ?> <?define PackageId = "45F34788-66AC-441C-B666-707FFA7F1EE9" ?> <!-- Product name as you want it to appear in Add/Remove Programs--> <?if $(var.Platform) = x64 ?> <?define ProductName = "XYZ (64 bit)" ?> <?define Win64 = "yes" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?define ProductId = "$(var.ProductId64)" ?> <?define MainDllName = "XYZ64.dll" ?> <?define MainDllSource = "....binWin64ReleaseXYZ64.dll" ?> <?else ?> <?define ProductName = "XYZ (32 bit)" ?> <?define Win64 = "no" ?> <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> <?define ProductId = "$(var.ProductId32)" ?> <?define MainDllName = "XYZ.dll" ?> <?define MainDllSource = "....binWin32ReleaseXYZ.dll" ?> <?endif ?> <?define UpgradeCode = "{C3763742-7C1C-4AB7-A404-F030B7550E97}" ?> <Product Id="$(var.ProductId)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Advanced Messaging Systems LLC" UpgradeCode="$(var.UpgradeCode)"> <Package Id="$(var.PackageId)" InstallerVersion="200" Compressed="yes" Description="XYZ Installer package" InstallPrivileges="elevated"/> <!-- No restore point --> <Property Id="MSIFASTINSTALL" Value="3" /> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="$(var.PlatformProgramFilesFolder)"> <Directory Id="INSTALLLOCATION" Name="XYZ"> <Component Id="XYZDll" Guid="E2CBEE41-6C0E-4A84-95C1-7282747B4A3D"> <File Id='MainDll' Name="$(var.MainDllName)" DiskId='1' Source="$(var.MainDllSource)" SelfRegCost="0" /> <!-- TODO: Insert files,registry keys,and other resources here. --> </Component> </Directory> </Directory> </Directory> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> <!-- Note: Custom actions to install/uninstall the dll using regsvr32.exe --> <CustomAction Id="RegisterDll" Directory="INSTALLLOCATION" ExeCommand='regsvr32.exe /s "[INSTALLLOCATION]$(var.MainDllName)"' Return="check"> </CustomAction> <CustomAction Id="UnregisterDll" Directory="INSTALLLOCATION" ExeCommand='regsvr32.exe /s /u "[INSTALLLOCATION]$(var.MainDllName)"'> </CustomAction> <Feature Id="ProductFeature" Title="XYZ" Level="1"> <ComponentRef Id="XYZDll" /> <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. --> <ComponentGroupRef Id="Product.Generated" /> </Feature> <InstallUISequence> <Custom Action="WixCloseApplications" Before="AppSearch"/> </InstallUISequence> <InstallExecuteSequence> <!-- Uninstall previous version before installing this one. --> <RemoveExistingProducts Before="InstallInitialize"/> <SelfRegModules/> </InstallExecuteSequence> <Icon Id="XYZ.ico" SourceFile="..GraphicsXYZ.ico"/> <Property Id="ARPPRODUCTICON" Value="XYZ.ico" /> <!-- UI --> <UIRef Id="WixUI_InstallDir"/> <UIRef Id="WixUI_ErrorProgressText" /> <WixVariable Id="WixUILicenseRtf" Value="..EULAlicense.rtf" /> <WixVariable Id="WixUIBannerBmp" Value="..Graphicsbanner.jpg" /> <WixVariable Id="WixUIDialogBmp" Value="..Graphicslogo.jpg" /> <!-- End UI --> </Product> </Wix> UPDATE.修改升级条目后,以下内容对我有用: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <!-- When creating a new install for the next version,these fields must be modified --> <?define ProductVersion = "2.0.4" ?> <?define ProductId64 = "*" ?> <?define ProductId32 = "*" ?> <?define PackageId = "*" ?> <!-- Product name as you want it to appear in Add/Remove Programs--> <?if $(var.Platform) = x64 ?> <?define ProductName = "XYZ (64 bit)" ?> <?define Win64 = "yes" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?define ProductId = "$(var.ProductId64)" ?> <?define MainDllName = "XYZ64.dll" ?> <?define MainDllSource = "....binWin64ReleaseXYZ64.dll" ?> <?else ?> <?define ProductName = "XYZ (32 bit)" ?> <?define Win64 = "no" ?> <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?> <?define ProductId = "$(var.ProductId32)" ?> <?define MainDllName = "XYZ.dll" ?> <?define MainDllSource = "....binWin32ReleaseXYZ.dll" ?> <?endif ?> <?define UpgradeCode = "{C3763742-7C1C-4AB7-A404-F030B7550E97}" ?> <Product Id="$(var.ProductId)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Advanced Messaging Systems LLC" UpgradeCode="$(var.UpgradeCode)" > <Package Id="$(var.PackageId)" InstallerVersion="200" Compressed="yes" Description="XYZ Installer package" InstallPrivileges="elevated" /> <!-- No restore point --> <Property Id="MSIFASTINSTALL" Value="3" /> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" OnlyDetect="no" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="PREVIOUSFOUND" /> </Upgrade> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="$(var.PlatformProgramFilesFolder)"> <Directory Id="INSTALLLOCATION" Name="XYZ"> <Component Id="XYZDll" Guid="E2CBEE41-6C0E-4A84-95C1-7282747B4A3D"> <File Id='MainDll' Name="$(var.MainDllName)" DiskId='1' Source="$(var.MainDllSource)" SelfRegCost="0" /> <!-- TODO: Insert files,and other resources here. --> </Component> </Directory> </Directory> </Directory> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" /> <!-- Note: Custom actions to install/uninstall the dll using regsvr32.exe --> <CustomAction Id="RegisterDll" Directory="INSTALLLOCATION" ExeCommand='regsvr32.exe /s "[INSTALLLOCATION]$(var.MainDllName)"' Return="check"> </CustomAction> <CustomAction Id="UnregisterDll" Directory="INSTALLLOCATION" ExeCommand='regsvr32.exe /s /u "[INSTALLLOCATION]$(var.MainDllName)"'> </CustomAction> <Feature Id="ProductFeature" Title="XYZ" Level="1"> <ComponentRef Id="XYZDll" /> <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. --> <ComponentGroupRef Id="Product.Generated" /> </Feature> <InstallUISequence> <Custom Action="WixCloseApplications" Before="AppSearch"/> </InstallUISequence> <InstallExecuteSequence> <RemoveExistingProducts After="InstallInitialize"/> <SelfRegModules/> </InstallExecuteSequence> <Icon Id="XYZ.ico" SourceFile="..GraphicsXYZ.ico"/> <Property Id="ARPPRODUCTICON" Value="XYZ.ico" /> <!-- UI --> <UIRef Id="WixUI_InstallDir"/> <UIRef Id="WixUI_ErrorProgressText" /> <WixVariable Id="WixUILicenseRtf" Value="..EULAlicense.rtf" /> <WixVariable Id="WixUIBannerBmp" Value="..Graphicsbanner.jpg" /> <WixVariable Id="WixUIDialogBmp" Value="..Graphicslogo.jpg" /> <!-- End UI --> </Product> </Wix>
如果你想要一个主要的升级,请从WiX MajorUpgrade元素开始.升级的一般规则是:
>旧产品的不同ProductCode和PackageCode. 在您的原始情况下,未遵循规则1和2意味着Windows认为已经安装了相同的产品并进入修复模式.这应该是你的第一个警告,因为重大升级看起来像是全新安装,而不是维修.如果在“程序和功能”中有两个条目,则表示尚未满足这4个要求中的一个或多个.如果您收到“已安装此产品的另一个版本”,则表示您未遵循规则1,并且行为的变化与ProductCode和PackageCode值相比与已安装的产品相比较. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- Win2008 r2 IIS7.5制定目录禁止执行脚本的方法
- Microsoft Dynamics CRM Online与Windows Azure托管网页IFr
- 自动注销Windows用户 – Windows 2003域
- 多次加载Dll以允许.Net中的多线程
- Windows 8应用程序(html和Javascript):从图片库(其他文件选
- 保留Listview滚动页面导航
- windows-7 – 监控串口通讯的免费软件
- 如何在Windows XP上的startup.bat文件中设置HeapDumpOnOutO
- winforms – Windows窗体字体问题第1部分
- 在windows上缺少nodejs npm全局配置
- windows10 下使用visual studio2015 编译MySQL5.
- 2019年最全windows10+office2019各版本激活密钥,
- Windows 7 – Windows 7上的VB6应用程序无法访问
- 新的统一Windows开发人员中心 – 如何取消发布/隐
- windows和linux生成的可执行文件之间有什么区别
- windows-server-2003 – 多个VLAN,多个子网,单个
- 具有可移植库的F#类型提供程序
- windows – 是否可以设置服务的处理器关联,并在重
- Windows 10 安装虚拟专用网client端
- windows – CMake / CPack可以为单个项目生成多个