diff --git a/README.md b/README.md index afd293d..e07ec2f 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ The install script is written using the excellent [Inno Setup](http://www.jrsoft Download -------- -Head on over to the [releases](https://github.com/SickChill/SickChillInstaller/releases/latest) tab. +Head on over to the [releases](https://github.com/SickChill/windows-sickchill/releases/latest) tab. How It Works ------------ -First, the installer will grab a 'seed' file, located [here](https://raw.github.com/SickChill/SickChillInstaller/master/seed.ini). This has a list of the dependencies, the URLs they can be downloaded from, their size, and an SHA1 hash. It also uses this file to make sure the user is running the latest version of the installer. +First, the installer will grab a 'seed' file, located [here](https://raw.github.com/SickChill/windows-sickchill/master/seed.ini). This has a list of the dependencies, the URLs they can be downloaded from, their size, and an SHA1 hash. It also uses this file to make sure the user is running the latest version of the installer. Once the user steps through the pages of the wizard, the installer downloads the dependency files and verifies the SHA1 hash. It then installs them into the directory chosen by the user. Once the dependencies are installed, it uses Git to clone the SickChill repository. diff --git a/SickChill.iss b/SickChill.iss index a15b316..c63358c 100644 --- a/SickChill.iss +++ b/SickChill.iss @@ -1,6 +1,6 @@ #include <.\idp\idp.iss> -#define SickChillInstallerVersion "v0.5.7" +#define SickChillInstallerVersion "v0.5.9" #define AppId "{{B0D7EA3E-CC34-4BE6-95D5-3C3D31E9E1B2}" #define AppName "SickChill" @@ -14,8 +14,8 @@ #define DefaultPort 8081 -#define InstallerVersion 10008 -#define InstallerSeedUrl "https://raw.githubusercontent.com/SickChill/SickChillInstaller/master/seed.ini" +#define InstallerVersion 10009 +#define InstallerSeedUrl "https://raw.githubusercontent.com/SickChill/windows-sickchill/master/seed.ini" #define AppRepoUrl "https://github.com/SickChill/SickChill.git" [Setup] @@ -162,6 +162,8 @@ const INVALID_HANDLE_VALUE = $FFFFFFFF; SLDF_RUNAS_USER = $00002000; CLSID_ShellLink = '{00021401-0000-0000-C000-000000000046}'; + SHCONTCH_NOPROGRESSBOX = 4; + SHCONTCH_RESPONDYESTOALL = 16; var // This lets AbortInstallation() terminate setup without prompting the user @@ -403,11 +405,45 @@ end; procedure InstallPython(); var ResultCode: Integer; + Shell: Variant; + ZipPath: Variant; + ZipFile: Variant; + TargetPath: Variant; + TargetFolder: Variant; + PythonPTHFile: Variant; begin InstallDepPage.SetText('Installing Python...', '') - Exec(ExpandConstantEx('{tmp}\{filename}', 'filename', PythonDep.Filename), ExpandConstant('/quiet TargetDir="{app}\Python3" InstallAllUsers=1'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode) + Shell := CreateOleObject('Shell.Application'); + if VarIsClear(Shell) then + AbortInstallation('Failed to create Shell.Application'); + + ZipPath := ExpandConstantEx('{tmp}\{filename}', 'filename', PythonDep.Filename); + if VarIsClear(ZipPath) then + AbortInstallation('ZIP Path failed'); + + ZipFile := Shell.NameSpace(ZipPath); + if VarIsClear(ZipFile) then + AbortInstallation('ZIP file does not exist or cannot be opened'); + + TargetPath := ExpandConstant('{app}\Python3'); + if ForceDirectories(TargetPath) then + begin + TargetFolder := Shell.NameSpace(TargetPath); + if VarIsClear(TargetFolder) then + AbortInstallation('Could not select target with shell'); + end + else + AbortInstallation('Creation of folder failed!'); + + TargetFolder.CopyHere(ZipFile.Items, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL); + + PythonPTHFile := ExpandConstant('{app}\Python3\python38._pth'); + SaveStringToFile(PythonPTHFile, #13#10 + '..\SickChill' + #13#10, True); + SaveStringToFile(PythonPTHFile, #13#10 + 'import site' + #13#10, True); + CleanPython() InstallDepPage.SetProgress(InstallDepPage.ProgressBar.Position+1, InstallDepPage.ProgressBar.Max) + ResultCode := 0 end; procedure InstallGit(); diff --git a/seed.ini b/seed.ini index 3bd2b29..b6b3f37 100644 --- a/seed.ini +++ b/seed.ini @@ -1,16 +1,16 @@ [Installer] -Version=10008 -DownloadUrl=https://github.com/SickChill/SickChillInstaller +Version=10009 +DownloadUrl=https://github.com/SickChill/windows-sickchill [Python.x86] -url=https://www.python.org/ftp/python/3.8.5/python-3.8.5.exe -size=26777232 -sha1=3aa5a0bb797977f5d26a39785ae4d87bb52023d3 +url=https://www.python.org/ftp/python/3.8.5/python-3.8.5-embed-win32.zip +size=7305731 +sha1=080728ee56fc64f65086e2a293a8982a22a910ce [Python.x64] -url=https://www.python.org/ftp/python/3.8.5/python-3.8.5-amd64.exe -size=27864320 -sha1=00123c4d6cabb2e07efc5848451dcd556a734cfa +url=https://www.python.org/ftp/python/3.8.5/python-3.8.5-embed-amd64.zip +size=8168581 +sha1=3cd35dc8bf94df27df93df2ba775665a35d4c9ec [Git.x86] url=https://github.com/git-for-windows/git/releases/download/v2.12.2.windows.1/PortableGit-2.12.2-32-bit.7z.exe