[959eb01] | 1 | """ |
---|
| 2 | This module generates .iss file according to the local config of |
---|
| 3 | the current application. Please make sure a file named "local_config.py" |
---|
| 4 | exists in the current directory. Edit local_config.py according to your needs. |
---|
| 5 | """ |
---|
[a1b8fee] | 6 | from __future__ import print_function |
---|
| 7 | |
---|
[914ba0a] | 8 | import os |
---|
[3d3275f] | 9 | import sys |
---|
[959eb01] | 10 | import string |
---|
| 11 | |
---|
[914ba0a] | 12 | root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
---|
| 13 | sys.path.insert(0, os.path.join(root, 'sasview-install', 'Lib', 'site-packages')) |
---|
| 14 | from sas.sasview import local_config |
---|
[a1b8fee] | 15 | |
---|
[5f51c86] | 16 | #REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1""" |
---|
[959eb01] | 17 | APPLICATION = str(local_config.__appname__ )+ '.exe' |
---|
| 18 | AppName = str(local_config.__appname__ ) |
---|
| 19 | AppVerName = str(local_config.__appname__ )+'-'+ str(local_config.__version__) |
---|
| 20 | Dev = '' |
---|
| 21 | if AppVerName.lower().count('dev') > 0: |
---|
| 22 | Dev = '-Dev' |
---|
| 23 | AppPublisher = local_config._copyright |
---|
| 24 | AppPublisherURL = local_config._homepage |
---|
| 25 | AppSupportURL = local_config._homepage |
---|
| 26 | AppUpdatesURL = local_config._homepage |
---|
| 27 | ChangesEnvironment = 'true' |
---|
[914ba0a] | 28 | DefaultDirName = os.path.join("{pf}" , AppName+Dev) |
---|
[959eb01] | 29 | DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName) |
---|
[914ba0a] | 30 | |
---|
[959eb01] | 31 | OutputBaseFilename = local_config.OutputBaseFilename |
---|
[460d3a1] | 32 | SetupIconFile = local_config.SetupIconFile_win |
---|
[959eb01] | 33 | LicenseFile = 'license.txt' |
---|
| 34 | DisableProgramGroupPage = 'yes' |
---|
| 35 | Compression = 'lzma' |
---|
| 36 | SolidCompression = 'yes' |
---|
| 37 | PrivilegesRequired = 'none' |
---|
| 38 | INSTALLER_FILE = 'installer' |
---|
| 39 | |
---|
| 40 | icon_path = local_config.icon_path |
---|
| 41 | media_path = local_config.media_path |
---|
| 42 | test_path = local_config.test_path |
---|
| 43 | |
---|
| 44 | def find_extension(): |
---|
| 45 | """ |
---|
| 46 | Describe the extensions that can be read by the current application |
---|
| 47 | """ |
---|
| 48 | list_data = [] |
---|
| 49 | list_app =[] |
---|
| 50 | try: |
---|
[914ba0a] | 51 | |
---|
[959eb01] | 52 | #(ext, type, name, flags) |
---|
| 53 | from sas.sascalc.dataloader.loader import Loader |
---|
| 54 | wild_cards = Loader().get_wildcards() |
---|
| 55 | for item in wild_cards: |
---|
| 56 | #['All (*.*)|*.*'] |
---|
[988deab] | 57 | file_type, ext = item.split("|*", 1) |
---|
[959eb01] | 58 | if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: |
---|
| 59 | list_data.append((ext, 'string', file_type)) |
---|
[a67ec83] | 60 | except Exception: |
---|
[959eb01] | 61 | pass |
---|
| 62 | try: |
---|
[988deab] | 63 | file_type, ext = local_config.APPLICATION_WLIST.split("|*", 1) |
---|
[959eb01] | 64 | if ext.strip() not in ['.', ''] and ext.strip() not in list_app: |
---|
| 65 | list_app.append((ext, 'string', file_type)) |
---|
[a67ec83] | 66 | except Exception: |
---|
[959eb01] | 67 | pass |
---|
| 68 | try: |
---|
| 69 | for item in local_config.PLUGINS_WLIST: |
---|
[988deab] | 70 | file_type, ext = item.split("|*", 1) |
---|
[959eb01] | 71 | if ext.strip() not in ['.', ''] and ext.strip() not in list_app: |
---|
[914ba0a] | 72 | list_app.append((ext, 'string', file_type)) |
---|
[a67ec83] | 73 | except Exception: |
---|
[959eb01] | 74 | pass |
---|
| 75 | return list_data, list_app |
---|
| 76 | DATA_EXTENSION, APP_EXTENSION = find_extension() |
---|
| 77 | |
---|
| 78 | def write_registry(data_extension=None, app_extension=None): |
---|
| 79 | """ |
---|
| 80 | create file association for windows. |
---|
| 81 | Allow open file on double click |
---|
| 82 | """ |
---|
| 83 | msg = "" |
---|
| 84 | if data_extension is not None and data_extension: |
---|
| 85 | msg = "\n\n[Registry]\n" |
---|
[988deab] | 86 | openwithlist = "OpenWithList\%s" % str(APPLICATION) |
---|
[959eb01] | 87 | for (ext, type, _) in data_extension: |
---|
| 88 | list = os.path.join(ext, openwithlist) |
---|
| 89 | msg += """Root: HKCR;\tSubkey: "%s";\t""" % str(list) |
---|
| 90 | msg += """ Flags: %s""" % str('uninsdeletekey noerror') |
---|
| 91 | msg += "\n" |
---|
| 92 | #list the file on right-click |
---|
| 93 | msg += """Root: HKCR; Subkey: "applications\%s\shell\open\command";\t"""\ |
---|
| 94 | % str(APPLICATION) |
---|
| 95 | msg += """ValueType: %s; """ % str('string') |
---|
[914ba0a] | 96 | msg += """ValueName: "%s";\t""" %str('') |
---|
[959eb01] | 97 | msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), |
---|
[914ba0a] | 98 | str('%')) |
---|
[959eb01] | 99 | msg += """ Flags: %s""" % str('uninsdeletevalue noerror') |
---|
| 100 | msg += "\n" |
---|
[914ba0a] | 101 | user_list = "Software\Classes" |
---|
[959eb01] | 102 | for (ext, type, _) in data_extension: |
---|
| 103 | list = os.path.join(user_list, ext, openwithlist) |
---|
| 104 | msg += """Root: HKCU;\tSubkey: "%s";\t""" % str(list) |
---|
| 105 | msg += """ Flags: %s""" % str('uninsdeletekey noerror') |
---|
| 106 | msg += "\n" |
---|
| 107 | #list the file on right-click |
---|
| 108 | user_list = os.path.join("Software", "Classes", "applications") |
---|
| 109 | msg += """Root: HKCU; Subkey: "%s\%s\shell\open\command";\t"""\ |
---|
| 110 | % (str(user_list), str(APPLICATION)) |
---|
| 111 | msg += """ValueType: %s; """ % str('string') |
---|
[914ba0a] | 112 | msg += """ValueName: "%s";\t""" %str('') |
---|
[959eb01] | 113 | msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), |
---|
[914ba0a] | 114 | str('%')) |
---|
[959eb01] | 115 | msg += """ Flags: %s""" % str('uninsdeletevalue noerror') |
---|
[914ba0a] | 116 | msg += "\n" |
---|
[959eb01] | 117 | if app_extension is not None and app_extension: |
---|
| 118 | for (ext, type, _) in app_extension: |
---|
| 119 | msg += """Root: HKCR;\tSubkey: "%s";\t""" % str(ext) |
---|
| 120 | msg += """ValueType: %s;\t""" % str(type) |
---|
[914ba0a] | 121 | #file type empty set the current application as the default |
---|
[959eb01] | 122 | #reader for this file. change the value of file_type to another |
---|
| 123 | #string modify the default reader |
---|
| 124 | file_type = '' |
---|
| 125 | msg += """ValueName: "%s";\t""" % str('') |
---|
| 126 | msg += """ValueData: "{app}\%s";\t""" % str(APPLICATION) |
---|
| 127 | msg += """ Flags: %s""" % str('uninsdeletevalue noerror') |
---|
| 128 | msg += "\n" |
---|
| 129 | msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(APPLICATION) |
---|
| 130 | msg += """ValueType: %s; """ % str('string') |
---|
[914ba0a] | 131 | msg += """ValueName: "%s";\t""" % str('') |
---|
| 132 | msg += """ValueData: "{app}\%s";\t""" % str("SasView File") |
---|
[959eb01] | 133 | msg += """ Flags: %s \t""" % str("uninsdeletekey noerror") |
---|
| 134 | msg += "\n" |
---|
[914ba0a] | 135 | |
---|
[959eb01] | 136 | #execute the file on double-click |
---|
| 137 | msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t""" % str(APPLICATION) |
---|
| 138 | msg += """ValueType: %s; """ % str('string') |
---|
[914ba0a] | 139 | msg += """ValueName: "%s";\t""" %str('') |
---|
[959eb01] | 140 | msg += """ValueData: \"""{app}\%s"" ""%s1\""";\t"""% (str(APPLICATION), |
---|
[914ba0a] | 141 | str('%')) |
---|
[959eb01] | 142 | msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") |
---|
[914ba0a] | 143 | msg += "\n" |
---|
[959eb01] | 144 | #create default icon |
---|
| 145 | msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile) |
---|
| 146 | msg += """ValueType: %s; """ % str('string') |
---|
[914ba0a] | 147 | msg += """ValueName: "%s";\t""" % str('') |
---|
[959eb01] | 148 | msg += """ValueData: "{app}\%s,0";\t""" % str(APPLICATION) |
---|
| 149 | msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") |
---|
[914ba0a] | 150 | msg += "\n" |
---|
| 151 | |
---|
[959eb01] | 152 | |
---|
| 153 | #SASVIEWPATH |
---|
| 154 | msg += """Root: HKLM; Subkey: "%s";\t""" % str('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') |
---|
| 155 | msg += """ValueType: %s; """ % str('expandsz') |
---|
[914ba0a] | 156 | msg += """ValueName: "%s";\t""" % str('SASVIEWPATH') |
---|
[959eb01] | 157 | msg += """ValueData: "{app}";\t""" |
---|
| 158 | msg += """ Flags: %s""" % str('uninsdeletevalue noerror') |
---|
| 159 | msg += "\n" |
---|
[914ba0a] | 160 | |
---|
[959eb01] | 161 | #PATH |
---|
| 162 | msg += """; Write to PATH (below) is disabled; need more tests\n""" |
---|
| 163 | msg += """;Root: HKCU; Subkey: "%s";\t""" % str('Environment') |
---|
| 164 | msg += """ValueType: %s; """ % str('expandsz') |
---|
[914ba0a] | 165 | msg += """ValueName: "%s";\t""" % str('PATH') |
---|
[959eb01] | 166 | msg += """ValueData: "%s;{olddata}";\t""" % str('%SASVIEWPATH%') |
---|
| 167 | msg += """ Check: %s""" % str('NeedsAddPath()') |
---|
| 168 | msg += "\n" |
---|
[914ba0a] | 169 | |
---|
[959eb01] | 170 | return msg |
---|
| 171 | |
---|
[a67ec83] | 172 | def write_languages(languages=('english',), msfile="compiler:Default.isl"): |
---|
[959eb01] | 173 | """ |
---|
| 174 | define the language of the application |
---|
[914ba0a] | 175 | """ |
---|
[959eb01] | 176 | msg = '' |
---|
[a67ec83] | 177 | if languages: |
---|
[959eb01] | 178 | msg = "\n\n[Languages]\n" |
---|
[a67ec83] | 179 | for lang in languages: |
---|
| 180 | msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), str(msfile)) |
---|
[914ba0a] | 181 | return msg |
---|
[959eb01] | 182 | |
---|
| 183 | def write_tasks(): |
---|
| 184 | """ |
---|
| 185 | create desktop icon |
---|
| 186 | """ |
---|
| 187 | msg = """\n\n[Tasks]\n""" |
---|
| 188 | msg += """Name: "desktopicon";\tDescription: "{cm:CreateDesktopIcon}";\t""" |
---|
| 189 | msg += """GroupDescription: "{cm:AdditionalIcons}";\tFlags: unchecked\n""" |
---|
| 190 | msg += """Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}";\t""" |
---|
| 191 | msg += """GroupDescription: "{cm:AdditionalIcons}";\n""" |
---|
| 192 | return msg |
---|
| 193 | |
---|
[988deab] | 194 | dist_path = "dist\sasview" |
---|
[959eb01] | 195 | def write_file(): |
---|
| 196 | """ |
---|
| 197 | copy some data files |
---|
| 198 | """ |
---|
| 199 | msg = "\n\n[Files]\n" |
---|
| 200 | msg += """Source: "%s\%s";\t""" % (dist_path, str(APPLICATION)) |
---|
| 201 | msg += """DestDir: "{app}";\tFlags: ignoreversion\n""" |
---|
[988deab] | 202 | msg += """Source: "dist\sasview\*";\tDestDir: "{app}";\t""" |
---|
[959eb01] | 203 | msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" |
---|
[988deab] | 204 | msg += """Source: "dist\sasview\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" |
---|
[959eb01] | 205 | msg += """Flags: recursesubdirs createallsubdirs\n""" |
---|
[988deab] | 206 | msg += """Source: "dist\sasview\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" |
---|
[959eb01] | 207 | msg += """Flags: recursesubdirs createallsubdirs\n""" |
---|
[914ba0a] | 208 | #msg += """Source: "dist\default_categories.json"; DestDir: "{userdesktop}\..\.sasview";\t""" |
---|
[959eb01] | 209 | #msg += """DestName: "categories.json";\n""" |
---|
| 210 | msg += """;\tNOTE: Don't use "Flags: ignoreversion" on any shared system files""" |
---|
| 211 | return msg |
---|
| 212 | |
---|
| 213 | def write_icon(): |
---|
| 214 | """ |
---|
| 215 | Create application icon |
---|
| 216 | """ |
---|
| 217 | msg = """\n\n[Icons]\n""" |
---|
| 218 | msg += """Name: "{group}\%s";\t""" % str(AppName) |
---|
| 219 | msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) |
---|
| 220 | msg += """WorkingDir: "{app}"; IconFilename: "{app}\images\\ball.ico" \n""" |
---|
| 221 | msg += """Name: "{group}\{cm:UninstallProgram, %s}";\t""" % str(AppName) |
---|
| 222 | msg += """ Filename: "{uninstallexe}" \n""" |
---|
| 223 | msg += """Name: "{commondesktop}\%s";\t""" % str(AppVerName) |
---|
| 224 | msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) |
---|
| 225 | msg += """Tasks: desktopicon; WorkingDir: "{app}" ; IconFilename: "{app}\images\\ball.ico" \n""" |
---|
| 226 | msg += """Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\%s";\t""" % str(AppVerName) |
---|
| 227 | msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) |
---|
| 228 | msg += """Tasks: quicklaunchicon; WorkingDir: "{app}"; IconFilename: "{app}\images\\ball.ico" \n""" |
---|
| 229 | return msg |
---|
| 230 | |
---|
| 231 | def write_run(): |
---|
| 232 | """ |
---|
| 233 | execute some file |
---|
| 234 | """ |
---|
| 235 | msg = """\n\n[Run]\n""" |
---|
| 236 | msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) |
---|
[914ba0a] | 237 | msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) |
---|
[959eb01] | 238 | msg += """Flags: nowait postinstall skipifsilent\n""" |
---|
| 239 | msg += """; Install the Microsoft C++ DLL redistributable package if it is """ |
---|
| 240 | msg += """provided and the DLLs are not present on the target system.\n""" |
---|
| 241 | msg += """; Note that the redistributable package is included if the app was """ |
---|
| 242 | msg += """built using Python 2.6 or 2.7, but not with 2.5.\n""" |
---|
| 243 | msg += """; Parameter options:\n""" |
---|
| 244 | msg += """; - for silent install use: "/q"\n""" |
---|
| 245 | msg += """; - for silent install with progress bar use: "/qb"\n""" |
---|
| 246 | msg += """; - for silent install with progress bar but disallow """ |
---|
| 247 | msg += """cancellation of operation use: "/qb!"\n""" |
---|
| 248 | msg += """; Note that we do not use the postinstall flag as this would """ |
---|
| 249 | msg += """display a checkbox and thus require the user to decide what to do.\n""" |
---|
| 250 | msg += """;Filename: "{app}\\vcredist_x86.exe"; Parameters: "/qb!"; """ |
---|
| 251 | msg += """WorkingDir: "{tmp}"; StatusMsg: "Installing Microsoft Visual """ |
---|
| 252 | msg += """C++ 2008 Redistributable Package ..."; Check: InstallVC90CRT(); """ |
---|
| 253 | msg += """Flags: skipifdoesntexist waituntilterminated\n""" |
---|
| 254 | return msg |
---|
| 255 | |
---|
| 256 | def write_dirs(): |
---|
| 257 | """ |
---|
| 258 | Define Dir permission |
---|
| 259 | """ |
---|
| 260 | msg = """\n\n[Dirs]\n""" |
---|
| 261 | msg += """Name: "{app}\%s";\t""" % str('') |
---|
[914ba0a] | 262 | msg += """Permissions: everyone-modify\t""" |
---|
| 263 | msg += """\n""" |
---|
[959eb01] | 264 | return msg |
---|
| 265 | |
---|
| 266 | def write_code(): |
---|
| 267 | """ |
---|
[914ba0a] | 268 | Code that checks the existing path and snaviewpath |
---|
[959eb01] | 269 | in the environmental viriables/PATH |
---|
| 270 | """ |
---|
| 271 | msg = """\n\n[Code]\n""" |
---|
[914ba0a] | 272 | msg += """function InstallVC90CRT(): Boolean;\n""" |
---|
[959eb01] | 273 | msg += """begin\n""" |
---|
| 274 | msg += """ Result := not DirExists('C:\WINDOWS\WinSxS\\x86_Microsoft.VC90.""" |
---|
| 275 | msg += """CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375');\n""" |
---|
| 276 | msg += """end;\n\n""" |
---|
[914ba0a] | 277 | msg += """function NeedsAddPath(): boolean;\n""" |
---|
| 278 | msg += """var\n""" |
---|
[959eb01] | 279 | msg += """ oldpath: string;\n""" |
---|
[914ba0a] | 280 | msg += """ newpath: string;\n""" |
---|
| 281 | msg += """ pathArr: TArrayOfString;\n""" |
---|
| 282 | msg += """ i: Integer;\n""" |
---|
| 283 | msg += """begin\n""" |
---|
[959eb01] | 284 | msg += """ RegQueryStringValue(HKEY_CURRENT_USER,'Environment',""" |
---|
| 285 | msg += """'PATH', oldpath)\n""" |
---|
| 286 | msg += """ oldpath := oldpath + ';';\n""" |
---|
| 287 | msg += """ newpath := '%SASVIEWPATH%';\n""" |
---|
| 288 | msg += """ i := 0;\n""" |
---|
| 289 | msg += """ while (Pos(';', oldpath) > 0) do begin\n""" |
---|
| 290 | msg += """ SetArrayLength(pathArr, i+1);\n""" |
---|
| 291 | msg += """ pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);\n""" |
---|
| 292 | msg += """ oldpath := Copy(oldpath, Pos(';', oldpath)+1,""" |
---|
| 293 | msg += """ Length(oldpath));\n""" |
---|
| 294 | msg += """ i := i + 1;\n""" |
---|
| 295 | msg += """ // Check if current directory matches app dir\n""" |
---|
| 296 | msg += """ if newpath = pathArr[i-1] \n""" |
---|
| 297 | msg += """ then begin\n""" |
---|
| 298 | msg += """ Result := False;\n""" |
---|
| 299 | msg += """ exit;\n""" |
---|
| 300 | msg += """ end;\n""" |
---|
| 301 | msg += """ end;\n""" |
---|
| 302 | msg += """ Result := True;\n""" |
---|
| 303 | msg += """end;\n""" |
---|
| 304 | msg += """\n""" |
---|
| 305 | return msg |
---|
| 306 | |
---|
| 307 | def write_uninstalldelete(): |
---|
| 308 | """ |
---|
| 309 | Define uninstalldelete |
---|
| 310 | """ |
---|
| 311 | msg = """\n[UninstallDelete]\n""" |
---|
| 312 | msg += """; Delete directories and files that are dynamically created by """ |
---|
| 313 | msg += """the application (i.e. at runtime).\n""" |
---|
| 314 | msg += """Type: filesandordirs; Name: "{app}\.matplotlib"\n""" |
---|
| 315 | msg += """Type: files; Name: "{app}\*.*"\n""" |
---|
| 316 | msg += """; The following is a workaround for the case where the """ |
---|
| 317 | msg += """application is installed and uninstalled but the\n""" |
---|
| 318 | msg += """;{app} directory is not deleted because it has user files. """ |
---|
| 319 | msg += """Then the application is installed into the\n""" |
---|
| 320 | msg += """; existing directory, user files are deleted, and the """ |
---|
| 321 | msg += """application is un-installed again. Without the\n""" |
---|
| 322 | msg += """; directive below, {app} will not be deleted because Inno Setup """ |
---|
| 323 | msg += """did not create it during the previous\n""" |
---|
| 324 | msg += """; installation.\n""" |
---|
| 325 | msg += """Type: dirifempty; Name: "{app}"\n""" |
---|
[914ba0a] | 326 | msg += """\n""" |
---|
[959eb01] | 327 | return msg |
---|
| 328 | |
---|
| 329 | def generate_installer(): |
---|
| 330 | """ |
---|
| 331 | """ |
---|
| 332 | TEMPLATE = "\n; Script generated by the Inno Setup Script Wizard\n" |
---|
| 333 | TEMPLATE += "\n; and local_config.py located in this directory.\n " |
---|
| 334 | TEMPLATE += "; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!" |
---|
[914ba0a] | 335 | TEMPLATE += "\n[Setup]\n\n" |
---|
[959eb01] | 336 | TEMPLATE += "ChangesAssociations=%s\n" %str('yes') |
---|
| 337 | TEMPLATE += "AppName=%s\n" % str(AppName) |
---|
| 338 | TEMPLATE += "AppVerName=%s\n" % str(AppVerName) |
---|
| 339 | TEMPLATE += "AppPublisher=%s\n" % str(AppPublisher) |
---|
| 340 | TEMPLATE += "AppPublisherURL=%s\n" % str(AppPublisherURL) |
---|
| 341 | TEMPLATE += "AppSupportURL=%s\n" % str(AppSupportURL) |
---|
| 342 | TEMPLATE += "AppUpdatesURL=%s \n" % str(AppUpdatesURL) |
---|
| 343 | TEMPLATE += "ChangesEnvironment=%s \n" % str(ChangesEnvironment) |
---|
| 344 | TEMPLATE += "DefaultDirName=%s\n" % str(DefaultDirName) |
---|
| 345 | TEMPLATE += "DefaultGroupName=%s\n" % str(DefaultGroupName) |
---|
| 346 | TEMPLATE += "DisableProgramGroupPage=%s\n" % str(DisableProgramGroupPage) |
---|
| 347 | TEMPLATE += "LicenseFile=%s\n" % str(LicenseFile) |
---|
| 348 | TEMPLATE += "OutputBaseFilename=%s\n" % str(OutputBaseFilename) |
---|
| 349 | TEMPLATE += "SetupIconFile=%s\n" % str(SetupIconFile) |
---|
| 350 | TEMPLATE += "Compression=%s\n" % str(Compression) |
---|
| 351 | TEMPLATE += "SolidCompression=%s\n" % str(SolidCompression) |
---|
| 352 | TEMPLATE += "PrivilegesRequired=%s\n" % str(PrivilegesRequired) |
---|
| 353 | TEMPLATE += "UsePreviousAppDir=no\n" |
---|
[914ba0a] | 354 | |
---|
[959eb01] | 355 | TEMPLATE += write_registry(data_extension=DATA_EXTENSION, |
---|
| 356 | app_extension=APP_EXTENSION) |
---|
[a67ec83] | 357 | TEMPLATE += write_languages() |
---|
[959eb01] | 358 | TEMPLATE += write_tasks() |
---|
| 359 | TEMPLATE += write_file() |
---|
| 360 | TEMPLATE += write_icon() |
---|
| 361 | TEMPLATE += write_run() |
---|
| 362 | TEMPLATE += write_dirs() |
---|
| 363 | TEMPLATE += write_code() |
---|
| 364 | TEMPLATE += write_uninstalldelete() |
---|
| 365 | path = '%s.iss' % str(INSTALLER_FILE) |
---|
[914ba0a] | 366 | f = open(path,'w') |
---|
[959eb01] | 367 | f.write(TEMPLATE) |
---|
| 368 | f.close() |
---|
[9c3d784] | 369 | print("Generate Inno setup installer script complete") |
---|
| 370 | print("A new file %s.iss should be created.Please refresh your directory" % str(INSTALLER_FILE)) |
---|
[914ba0a] | 371 | |
---|
[959eb01] | 372 | if __name__ == "__main__": |
---|
| 373 | generate_installer() |
---|