Skip to content

Commit d6d6e82

Browse files
committed
Use pypi release rather than git, simplify and solidify installer
Signed-off-by: miigotu <[email protected]>
1 parent ba3a881 commit d6d6e82

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

SickChill.iss

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <.\idp\idp.iss>
22

3-
#define SickChillInstallerVersion "v0.5.11"
3+
#define SickChillInstallerVersion "v0.6.0"
44

55
#define AppId "{{B0D7EA3E-CC34-4BE6-95D5-3C3D31E9E1B2}"
66
#define AppName "SickChill"
@@ -67,7 +67,7 @@ Name: "{group}\Edit {#AppName} Service"; Filename: "{app}\Installer\nssm.exe"; P
6767

6868
[Run]
6969
;SickChill
70-
Filename: "{app}\Git\cmd\git.exe"; Parameters: "clone {#AppRepoUrl} ""{app}\{#AppName}"""; StatusMsg: "Installing {#AppName}..."
70+
Filename: "{app}\Python3\tools\python.exe"; Parameters: "-m pip install sickchill"; StatusMsg: "Installing {#AppName}..."
7171
;Filename: "xcopy.exe"; Parameters: """C:\SRinstaller\SickChill"" ""{app}\{#AppName}"" /E /I /H /Y"; Flags: runminimized; StatusMsg: "Installing {#AppName}..."
7272
;Service
7373
Filename: "{app}\Installer\nssm.exe"; Parameters: "start ""{#AppServiceName}"""; Flags: runhidden; BeforeInstall: CreateService; StatusMsg: "Starting {#AppName} service..."
@@ -87,7 +87,6 @@ Filename: "{sys}\netsh.exe"; Parameters: "advfirewall firewall delete rule name=
8787
[UninstallDelete]
8888
Type: filesandordirs; Name: "{app}\Python3"
8989
Type: filesandordirs; Name: "{app}\Python"
90-
Type: filesandordirs; Name: "{app}\Git"
9190
Type: filesandordirs; Name: "{app}\{#AppName}"
9291
Type: dirifempty; Name: "{app}"
9392

@@ -170,7 +169,7 @@ var
170169
CancelWithoutPrompt: Boolean;
171170
ErrorMessage, LocalFilesDir: String;
172171
SeedDownloadPageId, DependencyDownloadPageId: Integer;
173-
PythonDep, GitDep: TDependency;
172+
PythonDep: TDependency;
174173
InstallDepPage: TOutputProgressWizardPage;
175174
OptionsPage: TInputQueryWizardPage;
176175
// Uninstall variables
@@ -255,13 +254,7 @@ begin
255254
// Make sure we're running the latest version of the installer
256255
CheckInstallerVersion(SeedFile)
257256
258-
if Is64BitInstallMode then
259-
Arch := 'x64'
260-
else
261-
Arch := 'x86';
262-
263257
ParseDependency(PythonDep, 'Python', SeedFile)
264-
ParseDependency(GitDep, 'Git.' + Arch, SeedFile)
265258
266259
DependencyDownloadPageId := idpCreateDownloadForm(wpPreparing)
267260
DownloadPage := PageFromID(DependencyDownloadPageId)
@@ -350,12 +343,11 @@ begin
350343
OldProgressString := WizardForm.StatusLabel.Caption;
351344
WizardForm.StatusLabel.Caption := ExpandConstant('Installing {#AppName} service...')
352345
353-
Exec(Nssm, ExpandConstant('install "{#AppServiceName}" "{app}\Python3\tools\python.exe" """{app}\{#AppName}\SickChill.py""" --nolaunch --port='+GetWebPort('')+' --datadir="""{app}\Data"""'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
346+
Exec(Nssm, ExpandConstant('install "{#AppServiceName}" "{app}\Python3\tools\python.exe" """{app}\Python3\tools\Scripts\SickChill.py""" --nolaunch --port='+GetWebPort('')+' --datadir="""{app}\Data"""'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
354347
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" AppDirectory "{app}\Data"'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
355348
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" Description "{#AppServiceDescription}"'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
356349
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" AppStopMethodSkip 6'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
357350
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" AppStopMethodConsole 20000'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
358-
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" AppEnvironmentExtra "PATH={app}\Git\cmd;%PATH%"'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
359351
360352
if WindowsVersion.NTPlatform and (WindowsVersion.Major = 10) and (WindowsVersion.Minor = 0) and (WindowsVersion.Build > 14393) then begin
361353
Exec(Nssm, ExpandConstant('set "{#AppServiceName}" AppNoConsole 1'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
@@ -436,25 +428,10 @@ begin
436428
AbortInstallation('Creation of folder failed!');
437429
438430
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-
444-
CleanPython()
445431
InstallDepPage.SetProgress(InstallDepPage.ProgressBar.Position+1, InstallDepPage.ProgressBar.Max)
446432
ResultCode := 0
447433
end;
448434
449-
procedure InstallGit();
450-
var
451-
ResultCode: Integer;
452-
begin
453-
InstallDepPage.SetText('Installing Git...', '')
454-
Exec(ExpandConstantEx('{tmp}\{filename}', 'filename', GitDep.Filename), ExpandConstant('-InstallPath="{app}\Git" -y -gm2'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
455-
InstallDepPage.SetProgress(InstallDepPage.ProgressBar.Position+1, InstallDepPage.ProgressBar.Max)
456-
end;
457-
458435
function VerifyDependency(Dependency: TDependency): Boolean;
459436
begin
460437
Result := True
@@ -467,14 +444,6 @@ begin
467444
InstallDepPage.SetProgress(InstallDepPage.ProgressBar.Position+1, InstallDepPage.ProgressBar.Max)
468445
end;
469446
470-
function VerifyDependencies(): Boolean;
471-
begin
472-
Result := True
473-
474-
Result := Result and VerifyDependency(PythonDep)
475-
Result := Result and VerifyDependency(GitDep)
476-
end;
477-
478447
function PrepareToInstall(var NeedsRestart: Boolean): String;
479448
begin
480449
if ErrorMessage <> '' then begin
@@ -487,9 +456,8 @@ begin
487456
try
488457
InstallDepPage.Show
489458
InstallDepPage.SetProgress(0, 6)
490-
if VerifyDependencies() then begin
459+
if VerifyDependency(PythonDep) then begin
491460
InstallPython()
492-
InstallGit()
493461
end else begin
494462
ErrorMessage := 'There was an error installing the required dependencies.'
495463
end;
@@ -619,7 +587,6 @@ begin
619587
Result := MemoDirInfo + NewLine + NewLine + \
620588
MemoGroupInfo + NewLine + NewLine + \
621589
'Download and install dependencies:' + NewLine + \
622-
Space + 'Git' + NewLine + \
623590
Space + 'Python' + NewLine + NewLine + \
624591
'Web server port:' + NewLine + Space + GetWebPort('')
625592

seed.ini

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,3 @@ url=https://www.nuget.org/api/v2/package/python/3.8.10
77
size=14219645
88
sha1=6b67898b2b22d61c0a6b42aa46b10cb4210446d7
99
filename="python.3.8.10.zip"
10-
11-
[Git.x86]
12-
url=https://github.com/git-for-windows/git/releases/download/v2.12.2.windows.1/PortableGit-2.12.2-32-bit.7z.exe
13-
size=34963472
14-
sha1=376ea855a1e1c56321a81fb6dff5edaf39e165ea
15-
16-
[Git.x64]
17-
url=https://github.com/git-for-windows/git/releases/download/v2.12.2.windows.1/PortableGit-2.12.2-64-bit.7z.exe
18-
size=34922280
19-
sha1=df9b2d3858b58375dd96cc048ba8ef81a3abbeb4

0 commit comments

Comments
 (0)