-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathollama_app.iss
101 lines (90 loc) · 3.21 KB
/
ollama_app.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
#define MyAppName "Ollama Chatbot"
#define MyAppVersion "0.2"
#define MyAppPublisher "Shojaei"
#define MyAppURL "https://github.com/mshojaei77/ollama_gui"
#define MyAppExeName "app.exe"
[Setup]
AppId={{599935BA-A515-448D-AD9E-39A505E7C10E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
OutputBaseFilename=OllamaChatbot_Setup_v{#MyAppVersion}
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
SetupIconFile=E:\ollama_gui\ollama.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription=Ollama Chatbot Installer
VersionInfoCopyright=© 2024 {#MyAppPublisher}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\ollama_gui\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\ollama_gui\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
var
OllamaCheckPage: TOutputMsgWizardPage;
procedure CreateOllamaCheckPage();
begin
OllamaCheckPage := CreateOutputMsgPage(wpWelcome,
'Checking Ollama Installation', 'Verifying Ollama is installed on your system',
'Please wait while Setup checks if Ollama is installed on your system. ' +
'Ollama is required for this application to function properly.');
end;
function CheckOllama(): Boolean;
var
ResultCode: Integer;
begin
OllamaCheckPage.Description := 'Checking for Ollama...';
if not Exec(ExpandConstant('{cmd}'), '/C ollama list', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
OllamaCheckPage.Description := 'Ollama is not installed or not in PATH. Please install Ollama before continuing.';
Result := False;
end
else
begin
OllamaCheckPage.Description := 'Ollama is installed and accessible.';
Result := True;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpReady then
begin
CreateOllamaCheckPage();
if not CheckOllama() then
begin
if MsgBox('Ollama is not detected. Do you want to continue anyway?', mbConfirmation, MB_YESNO) = IDNO then
WizardForm.Close;
end;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
if MsgBox(ExpandConstant('{cm:UninstallQuestion,{#MyAppName}}'), mbConfirmation, MB_YESNO) = IDNO then
Abort;
end;
end;