Skip to content

Commit 03950b6

Browse files
committed
Move the installation logic to the installer, not the bootstrapper
1 parent 42657c6 commit 03950b6

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

bootstrapper/bootstrapper.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using chocolatey.infrastructure.logging;
33
using System;
44
using System.Diagnostics;
5+
using System.Linq;
56
using System.Reflection;
67
using System.Security.Principal;
78

@@ -25,10 +26,8 @@ static void Main(string[] args)
2526
var choco = Lets.GetChocolatey();
2627
choco.SetCustomLogging(new NullLog());
2728

28-
choco.Set(conf => conf.CommandName = "upgrade");
29-
choco.RunConsole(new string[] { "-y", "--force", "chocolatey" });
30-
choco.Set(conf => conf.CommandName = "upgrade");
31-
choco.RunConsole(new string[] { "-y", "--force", "chocolateygui" });
29+
choco.Set(conf => conf.CommandName = args.FirstOrDefault());
30+
choco.RunConsole(args.Skip(1).ToArray());
3231
}
3332

3433
static bool IsAdministrator()

installer.iss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,21 @@ DisableDirPage=yes
3131
[Languages]
3232
Name: "english"; MessagesFile: "compiler:Default.isl"
3333

34+
[Types]
35+
Name: "full"; Description: "Full installation"
36+
Name: "custom"; Description: "Custom installation"; Flags: iscustom
37+
38+
[Components]
39+
Name: "chocolatey"; Description: "Chocolatey"; Types: custom full; Flags: fixed
40+
Name: "chocolateygui"; Description: "Graphical Interface for Chocolatey"; Types: custom full
41+
3442
[Files]
3543
Source: "{#BuildDirectory}/bootstrapper.exe"; DestDir: "{app}"; Flags: ignoreversion
3644
Source: "{#BuildDirectory}/chocolatey.dll"; DestDir: "{app}"; Flags: ignoreversion
3745
Source: "{#BuildDirectory}/log4net.dll"; DestDir: "{app}"; Flags: ignoreversion
3846

3947
[Run]
40-
Filename: "{app}\bootstrapper.exe"; Flags: runascurrentuser runhidden
48+
Filename: "{app}\bootstrapper.exe"; Parameters: "upgrade -y --force chocolatey"; \
49+
Flags: runascurrentuser runhidden; Components: chocolatey
50+
Filename: "{app}\bootstrapper.exe"; Parameters: "upgrade -y --force chocolateygui"; \
51+
Flags: runascurrentuser runhidden; Components: chocolateygui

0 commit comments

Comments
 (0)