我已经开发了一个 wix 代码来为我公司的应用程序创建一个 msi。当我在系统上安装 msi 时,如果该应用程序的旧版本已经存在 2.1.9115,它不会更新它并安装新创建的msi.It 单独安装,控制面板显示两个版本的应用程序。产品升级是我的问题的解决方案吗?我的代码是
<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Name='smart viewer' Id="*" Language='1033' Codepage='1252' Version='2.0.0'
Manufacturer='company' UpgradeCode='12345678-1234-1234-1234-111111111111'>
<Package Keywords='Installer,MSI' InstallerVersion='100' Languages='1033'
Compressed='yes' SummaryCodepage='1252'/>
<Media Id="1" Cabinet="myapp.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="my file">
<Directory Id="INSTALLFOLDER" Name="my folder">
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="ProgramsFolder"/>
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="DesktopFolder" Name="Desktop"/>
<Component Id='MainExecutable' Guid='*'>
<File Id='ExecutableFile' Name='my.exe' DiskId='1' Source='$(var.Sandbox)\Windows\release\my.exe' KeyPath='yes'>
<Shortcut Advertise="yes" Id="MyProductDesktopShortcut" Directory="DesktopFolder" Name="smart Viewer" WorkingDirectory="INSTALLFOLDER" Icon="Icon.exe"> <Icon Id="Icon.exe" SourceFile="$(var.Sandbox)\Installer-Win\Icon.ico"/>
</Shortcut>
<Shortcut Id="startmenu" Advertise="yes" Directory="ApplicationProgramsFolder" Name="smart Viewer" WorkingDirectory="ProgramMenuFolder" Icon="Icon.exe"> <Icon Id="Icon1.exe" SourceFile="$(var.Sandbox)\Installer-Win\Icon.ico"/>
</Shortcut>
</File>
<RemoveFolder Id="DeleteShortcutFolder" Directory="ApplicationProgramsFolder"
On="uninstall" />
</Component>