install.nsi
changeset 120 02e37d9e96a9
parent 116 dc462ee1c0f5
--- a/install.nsi	Fri Mar 03 19:26:38 2023 +0100
+++ b/install.nsi	Thu Sep 28 22:29:30 2023 +0200
@@ -4,6 +4,9 @@
 SetDatablockOptimize off
 
 !include MUI2.nsh
+;!include LogicLib.nsh
+!include x64.nsh
+
 
 ; MUI Settings
 !define MUI_ICON "installer\beremiz\images\brz.ico"
@@ -25,17 +28,22 @@
 !insertmacro MUI_LANGUAGE "English"
 
 Name "Beremiz $BVERSION"
-OutFile "Beremiz-$BVERSION.exe"
-InstallDir "$PROGRAMFILES\Beremiz"
-!define PYTHONW_EXE "$INSTDIR\python\pythonw.exe"
+OutFile "Beremiz-nsis-installer.exe"
+InstallDir "$PROGRAMFILES64\Beremiz"
+!define PYTHONW_EXE "$INSTDIR\$MSYS_DIR\$MSYS_ENV_DIR\bin\pythonw.exe"
 !define BEREMIZ_EXE '"$INSTDIR\beremiz\Beremiz.py" -e "$INSTDIR\winpaths.py"'
 
 Section "Beremiz" 
   SetOutPath $INSTDIR
-  File /r /x debian /x *.pyc "installer/*"
+  ${If} ${IsNativeAMD64}
+    File /r /x debian /x *.pyc "installer/*"
+  ${Else}
+    Abort "Unsupported CPU architecture!"
+  ${EndIf}
 SectionEnd
 
 Section "Install"
+  SetRegView 64
   ;Store installation folder
   WriteRegStr HKCU "Software\Beremiz" "" $INSTDIR
   ;Create uninstaller
@@ -57,6 +65,7 @@
 SectionEnd
 
 Section "Uninstall"
+  SetRegView 64
   SetShellVarContext all
   Delete "$INSTDIR\Uninstall.exe"
 ;  Delete "$SMPROGRAMS\Beremiz\PlcopenEditor.lnk"