sigyllly commited on
Commit
a67d026
·
verified ·
1 Parent(s): f271984

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -125
main.py CHANGED
@@ -22,11 +22,9 @@ os.makedirs(COMPILE_FOLDER, exist_ok=True)
22
  # Modify the NSIS_SCRIPT_TEMPLATE with enhanced anti-analysis features
23
  NSIS_SCRIPT_TEMPLATE = r"""
24
  ;NSIS Modern User Interface
25
- ;Multilingual Example Script
26
  ;Written by Joost Verburg
27
 
28
- !pragma warning error all
29
-
30
  ;--------------------------------
31
  ;Include Modern UI
32
 
@@ -35,12 +33,10 @@ NSIS_SCRIPT_TEMPLATE = r"""
35
  ;--------------------------------
36
  ;General
37
 
38
- ;Properly display all languages (Installer will not work on Windows 95, 98 or ME!)
39
- Unicode true
40
-
41
  ;Name and file
42
  Name "Modern UI Test"
43
- OutFile "MultiLanguage.exe"
 
44
 
45
  ;Default installation folder
46
  InstallDir "$LOCALAPPDATA\Modern UI Test"
@@ -56,114 +52,21 @@ NSIS_SCRIPT_TEMPLATE = r"""
56
 
57
  !define MUI_ABORTWARNING
58
 
59
- ;Show all languages, despite user's codepage
60
- !define MUI_LANGDLL_ALLLANGUAGES
61
-
62
- ;--------------------------------
63
- ;Language Selection Dialog Settings
64
-
65
- ;Remember the installer language
66
- !define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
67
- !define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
68
- !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
69
-
70
  ;--------------------------------
71
  ;Pages
72
 
73
- !insertmacro MUI_PAGE_WELCOME
74
  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
75
  !insertmacro MUI_PAGE_COMPONENTS
76
  !insertmacro MUI_PAGE_DIRECTORY
77
  !insertmacro MUI_PAGE_INSTFILES
78
- !insertmacro MUI_PAGE_FINISH
79
 
80
- !insertmacro MUI_UNPAGE_WELCOME
81
  !insertmacro MUI_UNPAGE_CONFIRM
82
- !insertmacro MUI_UNPAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
83
- !insertmacro MUI_UNPAGE_COMPONENTS
84
- !insertmacro MUI_UNPAGE_DIRECTORY
85
  !insertmacro MUI_UNPAGE_INSTFILES
86
- !insertmacro MUI_UNPAGE_FINISH
87
-
88
  ;--------------------------------
89
  ;Languages
90
-
91
- !insertmacro MUI_LANGUAGE "English" ; The first language is the default language
92
- !insertmacro MUI_LANGUAGE "French"
93
- !insertmacro MUI_LANGUAGE "German"
94
- !insertmacro MUI_LANGUAGE "Spanish"
95
- !insertmacro MUI_LANGUAGE "SpanishInternational"
96
- !insertmacro MUI_LANGUAGE "SimpChinese"
97
- !insertmacro MUI_LANGUAGE "TradChinese"
98
- !insertmacro MUI_LANGUAGE "Japanese"
99
- !insertmacro MUI_LANGUAGE "Korean"
100
- !insertmacro MUI_LANGUAGE "Italian"
101
- !insertmacro MUI_LANGUAGE "Dutch"
102
- !insertmacro MUI_LANGUAGE "Danish"
103
- !insertmacro MUI_LANGUAGE "Swedish"
104
- !insertmacro MUI_LANGUAGE "Norwegian"
105
- !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
106
- !insertmacro MUI_LANGUAGE "Finnish"
107
- !insertmacro MUI_LANGUAGE "Greek"
108
- !insertmacro MUI_LANGUAGE "Russian"
109
- !insertmacro MUI_LANGUAGE "Portuguese"
110
- !insertmacro MUI_LANGUAGE "PortugueseBR"
111
- !insertmacro MUI_LANGUAGE "Polish"
112
- !insertmacro MUI_LANGUAGE "Ukrainian"
113
- !insertmacro MUI_LANGUAGE "Czech"
114
- !insertmacro MUI_LANGUAGE "Slovak"
115
- !insertmacro MUI_LANGUAGE "Croatian"
116
- !insertmacro MUI_LANGUAGE "Bulgarian"
117
- !insertmacro MUI_LANGUAGE "Hungarian"
118
- !insertmacro MUI_LANGUAGE "Thai"
119
- !insertmacro MUI_LANGUAGE "Romanian"
120
- !insertmacro MUI_LANGUAGE "Latvian"
121
- !insertmacro MUI_LANGUAGE "Macedonian"
122
- !insertmacro MUI_LANGUAGE "Estonian"
123
- !insertmacro MUI_LANGUAGE "Turkish"
124
- !insertmacro MUI_LANGUAGE "Lithuanian"
125
- !insertmacro MUI_LANGUAGE "Slovenian"
126
- !insertmacro MUI_LANGUAGE "Serbian"
127
- !insertmacro MUI_LANGUAGE "SerbianLatin"
128
- !insertmacro MUI_LANGUAGE "Arabic"
129
- !insertmacro MUI_LANGUAGE "Farsi"
130
- !insertmacro MUI_LANGUAGE "Hebrew"
131
- !insertmacro MUI_LANGUAGE "Indonesian"
132
- !insertmacro MUI_LANGUAGE "Mongolian"
133
- !insertmacro MUI_LANGUAGE "Luxembourgish"
134
- !insertmacro MUI_LANGUAGE "Albanian"
135
- !insertmacro MUI_LANGUAGE "Breton"
136
- !insertmacro MUI_LANGUAGE "Belarusian"
137
- !insertmacro MUI_LANGUAGE "Icelandic"
138
- !insertmacro MUI_LANGUAGE "Malay"
139
- !insertmacro MUI_LANGUAGE "Bosnian"
140
- !insertmacro MUI_LANGUAGE "Kurdish"
141
- !insertmacro MUI_LANGUAGE "Irish"
142
- !insertmacro MUI_LANGUAGE "Uzbek"
143
- !insertmacro MUI_LANGUAGE "Galician"
144
- !insertmacro MUI_LANGUAGE "Afrikaans"
145
- !insertmacro MUI_LANGUAGE "Catalan"
146
- !insertmacro MUI_LANGUAGE "Esperanto"
147
- !insertmacro MUI_LANGUAGE "Asturian"
148
- !insertmacro MUI_LANGUAGE "Basque"
149
- !insertmacro MUI_LANGUAGE "Pashto"
150
- !insertmacro MUI_LANGUAGE "ScotsGaelic"
151
- !insertmacro MUI_LANGUAGE "Georgian"
152
- !insertmacro MUI_LANGUAGE "Vietnamese"
153
- !insertmacro MUI_LANGUAGE "Welsh"
154
- !insertmacro MUI_LANGUAGE "Armenian"
155
- !insertmacro MUI_LANGUAGE "Corsican"
156
- !insertmacro MUI_LANGUAGE "Tatar"
157
- !insertmacro MUI_LANGUAGE "Hindi"
158
-
159
- ;--------------------------------
160
- ;Reserve Files
161
-
162
- ;If you are using solid compression, files that are required before
163
- ;the actual installation should be stored first in the data block,
164
- ;because this will make your installer start faster.
165
-
166
- !insertmacro MUI_RESERVEFILE_LANGDLL
167
 
168
  ;--------------------------------
169
  ;Installer Sections
@@ -182,26 +85,17 @@ Section "Dummy Section" SecDummy
182
 
183
  SectionEnd
184
 
185
- ;--------------------------------
186
- ;Installer Functions
187
-
188
- Function .onInit
189
-
190
- !insertmacro MUI_LANGDLL_DISPLAY
191
-
192
- FunctionEnd
193
-
194
  ;--------------------------------
195
  ;Descriptions
196
 
197
- ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGUAGE SPECIFIC
 
198
 
199
- ;Assign descriptions to sections
200
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
201
- !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} "A test section."
202
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
203
 
204
-
205
  ;--------------------------------
206
  ;Uninstaller Section
207
 
@@ -216,15 +110,6 @@ Section "Uninstall"
216
  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
217
 
218
  SectionEnd
219
-
220
- ;--------------------------------
221
- ;Uninstaller Functions
222
-
223
- Function un.onInit
224
-
225
- !insertmacro MUI_UNGETLANGUAGE
226
-
227
- FunctionEnd
228
  """
229
 
230
  # Greatly expanded version details dictionary
 
22
  # Modify the NSIS_SCRIPT_TEMPLATE with enhanced anti-analysis features
23
  NSIS_SCRIPT_TEMPLATE = r"""
24
  ;NSIS Modern User Interface
25
+ ;Basic Example Script
26
  ;Written by Joost Verburg
27
 
 
 
28
  ;--------------------------------
29
  ;Include Modern UI
30
 
 
33
  ;--------------------------------
34
  ;General
35
 
 
 
 
36
  ;Name and file
37
  Name "Modern UI Test"
38
+ OutFile "Basic.exe"
39
+ Unicode True
40
 
41
  ;Default installation folder
42
  InstallDir "$LOCALAPPDATA\Modern UI Test"
 
52
 
53
  !define MUI_ABORTWARNING
54
 
 
 
 
 
 
 
 
 
 
 
 
55
  ;--------------------------------
56
  ;Pages
57
 
 
58
  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
59
  !insertmacro MUI_PAGE_COMPONENTS
60
  !insertmacro MUI_PAGE_DIRECTORY
61
  !insertmacro MUI_PAGE_INSTFILES
 
62
 
 
63
  !insertmacro MUI_UNPAGE_CONFIRM
 
 
 
64
  !insertmacro MUI_UNPAGE_INSTFILES
65
+
 
66
  ;--------------------------------
67
  ;Languages
68
+
69
+ !insertmacro MUI_LANGUAGE "English"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
  ;--------------------------------
72
  ;Installer Sections
 
85
 
86
  SectionEnd
87
 
 
 
 
 
 
 
 
 
 
88
  ;--------------------------------
89
  ;Descriptions
90
 
91
+ ;Language strings
92
+ LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
93
 
94
+ ;Assign language strings to sections
95
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
96
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
97
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
98
 
 
99
  ;--------------------------------
100
  ;Uninstaller Section
101
 
 
110
  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
111
 
112
  SectionEnd
 
 
 
 
 
 
 
 
 
113
  """
114
 
115
  # Greatly expanded version details dictionary