-
Notifications
You must be signed in to change notification settings - Fork 15
/
wizard_windows.iss
105 lines (93 loc) · 4.59 KB
/
wizard_windows.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
[Setup]
AppName=MORagents
AppVersion=0.2.0
DefaultDirName={commonpf}\MORagents
OutputDir=.\MORagentsWindowsInstaller
OutputBaseFilename=MORagentsSetup
WizardStyle=modern
[Messages]
WelcomeLabel1=Welcome to the MORagents Setup Wizard
WelcomeLabel2=This will install MORagents on your computer. Please click Next to continue.
[Files]
Source: "dist\MORagents\MORagents.exe"; DestDir: "{app}"
Source: "dist\MORagents\_internal\*"; DestDir: "{app}\_internal"; Flags: recursesubdirs
Source: "images\moragents.ico"; DestDir: "{app}"
Source: "LICENSE.md"; DestDir: "{app}"; Flags: isreadme
Source: "{tmp}\DockerDesktopInstaller.exe"; DestDir: "{tmp}"; Flags: external deleteafterinstall
Source: "{tmp}\OllamaSetup.exe"; DestDir: "{tmp}"; Flags: external deleteafterinstall
Source: "runtime_setup_windows.py"; DestDir: "{app}"
[Icons]
Name: "{commondesktop}\MORagents"; Filename: "{app}\MORagents.exe"; IconFilename: "{app}\moragents.ico"
[Run]
Filename: "{tmp}\DockerDesktopInstaller.exe"; Parameters: "install"; StatusMsg: "Installing Docker Desktop..."; Flags: waituntilterminated
Filename: "{tmp}\OllamaSetup.exe"; StatusMsg: "Installing Ollama..."; Flags: waituntilterminated
Filename: "{app}\LICENSE.md"; Description: "View License Agreement"; Flags: postinstall shellexec skipifsilent
Filename: "{app}\MORagents.exe"; Description: "Launch MORagents"; Flags: postinstall nowait skipifsilent unchecked
Filename: "cmd.exe"; Parameters: "/c ollama pull llama3.2:3b"; StatusMsg: "Pulling llama3.2:3b model..."; Flags: runhidden waituntilterminated
Filename: "cmd.exe"; Parameters: "/c ollama pull nomic-embed-text"; StatusMsg: "Pulling nomic-embed-text model..."; Flags: runhidden waituntilterminated
[Code]
var
EULAAccepted: Boolean;
DownloadPage: TDownloadWizardPage;
EULAPage: TOutputMsgWizardPage;
procedure InitializeWizard;
begin
EULAPage := CreateOutputMsgPage(wpWelcome,
'License Agreement', 'Please read the following License Agreement carefully',
'By continuing, you acknowledge that you have read and agreed to the License. ' + #13#10 +
'MIT License' + #13#10 +
'Copyright (c) 2024 Liquid Tensor LLC' + #13#10 +
'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), ' +
'to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, ' +
'and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: ' +
'The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. ' + #13#10 +
'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ' +
'INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ' +
'PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, ' +
'DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ' +
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + #13#10 + #13#10 +
'By clicking Next, installing, and/or using the MORagents software you accept the terms of the License agreement.');
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = EULAPage.ID then
begin
EULAAccepted := True;
end
else if CurPageID = wpReady then
begin
if not EULAAccepted then
begin
MsgBox('You must accept the License Agreement to continue.', mbError, MB_OK);
Result := False;
Exit;
end;
DownloadPage.Clear;
DownloadPage.Add('https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe', 'DockerDesktopInstaller.exe', '');
DownloadPage.Add('https://ollama.com/download/OllamaSetup.exe', 'OllamaSetup.exe', '');
DownloadPage.Show;
try
try
DownloadPage.Download;
Result := True;
except
if DownloadPage.AbortedByUser then
Log('Aborted by user.')
else
SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
Result := False;
end;
finally
DownloadPage.Hide;
end;
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
{ Skip EULA page if already accepted }
if (PageID = EULAPage.ID) and EULAAccepted then
Result := True;
end;