-
Notifications
You must be signed in to change notification settings - Fork 0
/
nunn32.iss
169 lines (146 loc) · 7.72 KB
/
nunn32.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Nunn Library"
#define MyAppVersion "1.56"
#define MyAppPublisher "antonino.calderone@gmail.com"
#define MyAppURL "http://www.nunnlib.eu"
#define MyAppExeName "ocr_test.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{FAB3A99E-879A-4177-8DB0-2BCFB23E48DB}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=COPYING
InfoBeforeFile=NEWS
InfoAfterFile=README
OutputDir=x64
OutputBaseFilename=nunn32_setup_{#MyAppVersion}
SetupIconFile=
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: assocNet; Description: Associate ocr_test with .net files
[Files]
Source: "Release\ocr_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\winttt.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\mnist_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\tictactoe.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\xor_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\hopfield_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\and_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\counter_test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\nunn_topo.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "Release\titanic.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "ocr_test.net"; DestDir: "{app}\Nets"; Flags: ignoreversion
Source: "tictactoe\tictactoe.net"; DestDir: "{app}\Nets"; Flags: ignoreversion
Source: "*.tar.gz"; DestDir: "{app}\Source"; Flags: ignoreversion
Source: "AUTHORS"; DestDir: "{app}\Documentation"; Flags: ignoreversion
Source: "COPYING"; DestDir: "{app}\LicenseFiles"; Flags: ignoreversion
Source: "README"; DestDir: "{app}\Documentation"; Flags: ignoreversion
Source: "THANKS"; DestDir: "{app}\Documentation"; Flags: ignoreversion
Source: "NEWS"; DestDir: "{app}\Documentation"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\ocr_test.exe"; Filename: "{app}\ocr_test.exe"
Name: "{group}\mnist_test"; Filename: "{app}\mnist_test.exe"; IconFilename: "{app}\mnist_test.exe"
Name: "{group}\tictactoe for Windows"; Filename: "{app}\winttt.exe"; IconFilename: "{app}\winttt.exe"
Name: "{group}\tictactoe"; Filename: "{app}\tictactoe.exe"; IconFilename: "{app}\winttt.exe"
Name: "{group}\xor_test"; Filename: "{app}\xor_test.exe"; IconFilename: "{app}\xor_test.exe"
Name: "{group}\hopfield_test"; Filename: "{app}\hopfield_test.exe"; IconFilename: "{app}\hopfield_test.exe"
Name: "{group}\and_test"; Filename: "{app}\and_test.exe"; IconFilename: "{app}\and_test.exe"
Name: "{group}\counter_test"; Filename: "{app}\counter_test.exe"; IconFilename: "{app}\counter_test.exe"
Name: "{group}\nunn_topo"; Filename: "{app}\nunn_topo.exe"; IconFilename: "{app}\nunn_topo.exe"
Name: "{group}\titanic"; Filename: "{app}\titanic.exe"; IconFilename: "{app}\titanic.exe"
; Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{group}\Doc"; Filename: "{app}\Documentation"
Name: "{group}\Nets"; Filename: "{app}\Nets"
Name: "{group}\Source"; Filename: "{app}\Source"
[Run]
; Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKCR; SubKey: .net; ValueType: string; ValueData: nunnFile; Flags: uninsdeletekey; Tasks: assocNet; Check: GlobalRegClasses
Root: HKCR; SubKey: netFile; ValueType: string; ValueData: nunn File; Flags: uninsdeletekey; Tasks: assocNet; Check: GlobalRegClasses
Root: HKCR; SubKey: netFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\ocr_test.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocNet; Check: GlobalRegClasses
Root: HKCR; Subkey: netFile\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocNet; Check: GlobalRegClasses
Root: HKCU; Subkey: Software\Classes\.bas; ValueType: string; ValueData: netFile; Flags: uninsdeletekey; Check: not GlobalRegClasses
Root: HKCU; SubKey: Software\Classes\netFile; ValueType: string; ValueData: nunn File; Flags: uninsdeletekey; Tasks: assocNet; Check: not GlobalRegClasses
Root: HKCU; SubKey: Software\Classes\netFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\ocr_test.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: assocNet; Check: not GlobalRegClasses
Root: HKCU; Subkey: Software\Classes\netFile\DefaultIcon; ValueType: string; ValueData: {app}\icons\pwiki.ico,0; Flags: uninsdeletevalue; Tasks: assocNet; Check: not GlobalRegClasses
[Code]
var
UserModeQuestion: TInputOptionWizardPage;
NotAdminMessage: TOutputMsgWizardPage;
function ShouldAskForUsermode: Boolean;
begin
result := UsingWinNT and IsAdminLoggedOn;
end;
procedure InitializeWizard;
begin
if ShouldAskForUsermode then begin
UserModeQuestion := CreateInputOptionPage(wpLicense,
'Installation mode',
'You install as admin, choose for whom you want to install',
'Install {#MyAppName} for',
True, False);
UserModeQuestion.Add('All Users');
UserModeQuestion.Add('Current User');
UserModeQuestion.SelectedValueIndex := 0;
end
else if UsingWinNT then begin
NotAdminMessage := CreateOutputMsgPage(wpLicense,
'Not in admin mode', 'You should install as admin',
'This program can be installed for all users if you run it as administrator. ' +
'You can now abort the setup and log in as administrator.'#13#13 +
'If you cannot or don''t want to do that, you can just continue and install ' +
'it for current user only.'#13#13 +
'If you continue, be aware that the installer maybe can''t ' +
'install in the suggested default directory. You may receive an ' +
'error message if you try that.');
end
end;
function IconDest(Param: String): String;
begin
if ShouldAskForUsermode() and (UserModeQuestion.SelectedValueIndex = 0) then
// All users
Result := ExpandConstant('{commonprograms}\{groupname}')
else
// Current user
Result := ExpandConstant('{userprograms}\{groupname}');
end;
function GlobalRegClasses: Boolean;
// Returns true iff registry entries should go to global HK_CR root.
// If false, they go to HK_CU\Software\Classes
begin
if ShouldAskForUsermode() and (UserModeQuestion.SelectedValueIndex = 0) then
Result := true
else
Result := not UsingWinNT; // On Win 98/ME, it should always return true
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
resultCode: Integer;
begin
// Call our function just before the actual uninstall process begins
if CurUninstallStep = usUninstall then
begin
if MsgBox('Do you also want to remove your personal settings?',
mbConfirmation, MB_YESNO) = idYes then
begin
//Not Yet
//Exec(ExpandConstant('{app}/{#MyAppExeName}'), '--deleteconfig',
// ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, resultCode);
end;
end;
end;