|
1 | 1 | #include <.\idp\idp.iss> |
2 | 2 |
|
3 | | -#define SickChillInstallerVersion "v0.5.7" |
| 3 | +#define SickChillInstallerVersion "v0.5.9" |
4 | 4 |
|
5 | 5 | #define AppId "{{B0D7EA3E-CC34-4BE6-95D5-3C3D31E9E1B2}" |
6 | 6 | #define AppName "SickChill" |
|
14 | 14 |
|
15 | 15 | #define DefaultPort 8081 |
16 | 16 |
|
17 | | -#define InstallerVersion 10008 |
18 | | -#define InstallerSeedUrl "https://raw.githubusercontent.com/SickChill/SickChillInstaller/master/seed.ini" |
| 17 | +#define InstallerVersion 10009 |
| 18 | +#define InstallerSeedUrl "https://raw.githubusercontent.com/SickChill/windows-sickchill/master/seed.ini" |
19 | 19 | #define AppRepoUrl "https://github.com/SickChill/SickChill.git" |
20 | 20 |
|
21 | 21 | [Setup] |
@@ -162,6 +162,8 @@ const |
162 | 162 | INVALID_HANDLE_VALUE = $FFFFFFFF; |
163 | 163 | SLDF_RUNAS_USER = $00002000; |
164 | 164 | CLSID_ShellLink = '{00021401-0000-0000-C000-000000000046}'; |
| 165 | + SHCONTCH_NOPROGRESSBOX = 4; |
| 166 | + SHCONTCH_RESPONDYESTOALL = 16; |
165 | 167 |
|
166 | 168 | var |
167 | 169 | // This lets AbortInstallation() terminate setup without prompting the user |
@@ -403,11 +405,45 @@ end; |
403 | 405 | procedure InstallPython(); |
404 | 406 | var |
405 | 407 | ResultCode: Integer; |
| 408 | + Shell: Variant; |
| 409 | + ZipPath: Variant; |
| 410 | + ZipFile: Variant; |
| 411 | + TargetPath: Variant; |
| 412 | + TargetFolder: Variant; |
| 413 | + PythonPTHFile: Variant; |
406 | 414 | begin |
407 | 415 | InstallDepPage.SetText('Installing Python...', '') |
408 | | - Exec(ExpandConstantEx('{tmp}\{filename}', 'filename', PythonDep.Filename), ExpandConstant('/quiet TargetDir="{app}\Python3" InstallAllUsers=1'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode) |
| 416 | + Shell := CreateOleObject('Shell.Application'); |
| 417 | + if VarIsClear(Shell) then |
| 418 | + AbortInstallation('Failed to create Shell.Application'); |
| 419 | +
|
| 420 | + ZipPath := ExpandConstantEx('{tmp}\{filename}', 'filename', PythonDep.Filename); |
| 421 | + if VarIsClear(ZipPath) then |
| 422 | + AbortInstallation('ZIP Path failed'); |
| 423 | +
|
| 424 | + ZipFile := Shell.NameSpace(ZipPath); |
| 425 | + if VarIsClear(ZipFile) then |
| 426 | + AbortInstallation('ZIP file does not exist or cannot be opened'); |
| 427 | +
|
| 428 | + TargetPath := ExpandConstant('{app}\Python3'); |
| 429 | + if ForceDirectories(TargetPath) then |
| 430 | + begin |
| 431 | + TargetFolder := Shell.NameSpace(TargetPath); |
| 432 | + if VarIsClear(TargetFolder) then |
| 433 | + AbortInstallation('Could not select target with shell'); |
| 434 | + end |
| 435 | + else |
| 436 | + AbortInstallation('Creation of folder failed!'); |
| 437 | +
|
| 438 | + TargetFolder.CopyHere(ZipFile.Items, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL); |
| 439 | +
|
| 440 | + PythonPTHFile := ExpandConstant('{app}\Python3\python38._pth'); |
| 441 | + SaveStringToFile(PythonPTHFile, #13#10 + '..\SickChill' + #13#10, True); |
| 442 | + SaveStringToFile(PythonPTHFile, #13#10 + 'import site' + #13#10, True); |
| 443 | +
|
409 | 444 | CleanPython() |
410 | 445 | InstallDepPage.SetProgress(InstallDepPage.ProgressBar.Position+1, InstallDepPage.ProgressBar.Max) |
| 446 | + ResultCode := 0 |
411 | 447 | end; |
412 | 448 |
|
413 | 449 | procedure InstallGit(); |
|
0 commit comments