diff --git a/platforms/win32/winbareos-nsi.spec b/platforms/win32/winbareos-nsi.spec index 4e1d221ba92..104b4c62a63 100644 --- a/platforms/win32/winbareos-nsi.spec +++ b/platforms/win32/winbareos-nsi.spec @@ -89,8 +89,8 @@ cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %_sourcedir/LICENSE $RPM_BUILD_ROOT/rele cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %_sourcedir/LICENSE $RPM_BUILD_ROOT/release64 -makensis -DPRODUCT_VERSION=%version-%release $RPM_BUILD_ROOT/release32/winbareos.nsi -makensis -DPRODUCT_VERSION=%version-%release $RPM_BUILD_ROOT/release64/winbareos.nsi +makensis -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=32 $RPM_BUILD_ROOT/release32/winbareos.nsi +makensis -DPRODUCT_VERSION=%version-%release -DBIT_WIDTH=64 $RPM_BUILD_ROOT/release64/winbareos.nsi %install mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir} diff --git a/platforms/win32/winbareos.nsi b/platforms/win32/winbareos.nsi index 5e407046709..3772c8aa3e0 100644 --- a/platforms/win32/winbareos.nsi +++ b/platforms/win32/winbareos.nsi @@ -75,6 +75,7 @@ Var hwnd !include "StrFunc.nsh" !include "WinMessages.nsh" !include "nsDialogs.nsh" +!include "x64.nsh" # call functions once to have them included ${StrCase} @@ -448,7 +449,25 @@ FunctionEnd Function .onInit +# check if we are installing on 64Bit, then do some settings + ${If} ${RunningX64} # 64Bit OS + ${If} ${BIT_WIDTH} == '32' + MessageBox MB_OK|MB_ICONQUESTION "You are running a 32 Bit Installer on a 64Bit OS.$\r$\n Please use the 64Bit installer." + Abort + ${EndIf} + StrCpy $INSTDIR "$PROGRAMFILES64\${PRODUCT_NAME}" + SetRegView 64 + ${EnableX64FSRedirection} + ${Else} # 32Bit OS + ${If} ${BIT_WIDTH} == '64' + MessageBox MB_OK|MB_ICONQUESTION "You are running a 64 Bit Installer on a 32Bit OS.$\r$\n Please use the 32Bit installer." + Abort + ${EndIf} + ${EndIf} + + +# check if software is already installed ClearErrors ReadRegStr $2 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" @@ -457,8 +476,6 @@ Function .onInit Abort - - # Parameters: # Needed for Client and Tray-Mon: #