Настройка WiX обнаружение и удаление Inno setup - PullRequest
0 голосов
/ 12 июня 2018

В настройке WiX мне нужно определить, установлена ​​ли предыдущая версия с помощью установки Inno, и удалить предыдущую версию.

1 Ответ

0 голосов
/ 12 июня 2018
<Property Id='INNO_UNINSTALLER_64'>
  <RegistrySearch Id='LocateInnoUninstaller64' Type='file' Root='HKLM'
                  Key='SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}_is1'
                  Name='UninstallString'>
    <FileSearch Id='InnoUninstallerExe64' Name='unins000.exe' />
  </RegistrySearch>
</Property>
<Property Id='INNO_UNINSTALLER_32'>
  <RegistrySearch Id='LocateInnoUninstaller32' Type='file' Root='HKLM'
                  Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}_is1'
                  Name='UninstallString'>
    <FileSearch Id='InnoUninstallerExe32' Name='unins000.exe' />
  </RegistrySearch>
</Property>

<CustomAction Id="ca.RemoveInno64" Property="INNO_UNINSTALLER_64" ExeCommand="/SILENT" Return="check" />
<CustomAction Id="ca.RemoveInno32" Property="INNO_UNINSTALLER_32" ExeCommand="/SILENT" Return="check" />

<InstallExecuteSequence>
  <Custom Action="ca.RemoveInno64" Before="InstallFiles">INNO_UNINSTALLER_64</Custom>
  <Custom Action="ca.RemoveInno32" Before="InstallFiles"><![CDATA[INNO_UNINSTALLER_32 AND NOT INNO_UNINSTALLER_64]]></Custom>
</InstallExecuteSequence>

Код будет искать в реестре Inno setup UninstallString и найдет деинсталлятор unins000.exe.Inno setup registry

...