legacy.iss 1019 B

123456789101112131415161718192021222324252627282930313233343536
  1. #define LEGACY_INSTALLER_APPID "{9B86AC7F-53B3-4E31-B245-D4602D16F5C8}"
  2. [Code]
  3. {
  4. Legacy Installer Functionality
  5. }
  6. {
  7. Checks if the MSI Installer is installed
  8. }
  9. function IsLegacyInstallerInstalled: Boolean;
  10. var
  11. Value: string;
  12. UninstallKey1, UninstallKey2: string;
  13. begin
  14. UninstallKey1 := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#LEGACY_INSTALLER_APPID}';
  15. UninstallKey2 := 'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#LEGACY_INSTALLER_APPID}';
  16. Result := (
  17. RegQueryStringValue(HKLM, UninstallKey1, 'UninstallString', Value) or
  18. RegQueryStringValue(HKCU, UninstallKey1, 'UninstallString', Value) or
  19. RegQueryStringValue(HKLM, UninstallKey2, 'UninstallString', Value)
  20. ) and (Value <> '');
  21. end;
  22. {
  23. Uninstalls Legacy Installer
  24. }
  25. procedure UninstallLegacyInstaller;
  26. var
  27. ResultCode: Integer;
  28. begin
  29. Log('Uninstall MSI installer item');
  30. ResultCode := MsiExecUnins('{#LEGACY_INSTALLER_APPID}');
  31. Log('Result code ' + IntToStr(ResultCode));
  32. end;