From 43f8306a83b7d3c973a7e02e4da01d5df9abd8a2 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 28 Jun 2018 10:56:17 +0200 Subject: [PATCH] fix bad type in setup --- build/win32/code.iss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/win32/code.iss b/build/win32/code.iss index 552d79f2439..b16073061d3 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -957,7 +957,6 @@ Root: {#EnvironmentRootKey}; Subkey: "{#EnvironmentKey}"; ValueType: expandsz; V // Don't allow installing conflicting architectures function InitializeSetup(): Boolean; var - RegRootKey: String; RegKey: String; ThisArch: String; AltArch: String; @@ -965,10 +964,15 @@ begin Result := True; #if "user" == InstallTarget - if '{#Arch}' = 'ia32' then RegRootKey := 'HKLM32' else RegRootKey := 'HKLM64'; + #if "ia32" == Arch + #define IncompatibleArchRootKey "HKLM32" + #else + #define IncompatibleArchRootKey "HKLM64" + #endif + RegKey := 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + copy('{#IncompatibleTargetAppId}', 2, 38) + '_is1'; - if RegKeyExists(RegRootKey, RegKey) then begin + if RegKeyExists({#IncompatibleArchRootKey}, RegKey) then begin if MsgBox('{#NameShort} is already installed on this system for all users. Are you sure you want to install it for this user?', mbConfirmation, MB_YESNO) = IDNO then begin Result := false; end;