Skip to content

Commit 9ca77fa

Browse files
committed
Adding separate .iss files for building console and no console versions of the installer
1 parent dc01779 commit 9ca77fa

File tree

5 files changed

+183
-8
lines changed

5 files changed

+183
-8
lines changed

make.py

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Location of Windows files
2525
APP_FILE = os.path.join(BASE_DIR, "ODMTools.py")
2626
MAKE_FILE = os.path.realpath(__file__)
27-
VERSION_FILE = os.path.join(BASE_DIR, "version.txt")
27+
VERSION_FILE = os.path.join(SETUP_DIR, "version.txt")
2828

2929
# Location of Innosetup Installer
3030
INNO_SCRIPT = os.path.join(WIN_DIR, "odmtools_setup.iss")
@@ -111,6 +111,14 @@ def printInfo():
111111

112112
check_if_dirs_exist()
113113

114+
def obtain_exe_filename(console=False):
115+
if console:
116+
return "{app}_{version}_{os}_{arch}_{type}".format(app=data.app_name,
117+
version=data.version, os=sys.platform, arch='x86_64', type= "console")
118+
else:
119+
return "{app}_{version}_{os}_{arch}".format(app=data.app_name,
120+
version=data.version, os=sys.platform, arch='x86_64')
121+
114122
def delete_old_out_dir():
115123
loc_exists = os.path.exists(DIST_DIR)
116124
isFile = os.path.isfile(DIST_DIR)
@@ -125,16 +133,34 @@ def delete_old_out_dir():
125133
print "Nothing to remove"
126134

127135
def run_pyinstaller():
136+
"""
137+
Create a non-console version and a console version
138+
"""
139+
128140
try:
141+
## No console
142+
os.system('pyinstaller '
143+
'--clean '
144+
'-n %s ' % obtain_exe_filename() +
145+
'--distpath=%s ' % DIST_DIR +
146+
'--workpath=%s ' % WORK_DIR +
147+
'--specpath=%s ' % WIN_DIR +
148+
'--upx-dir=%s ' % BASE_DIR +
149+
'--icon=%s ' % WIN_ICON_FILE +
150+
'--version-file=%s ' % VERSION_FILE +
151+
'--windowed '
152+
'--noconfirm ' + APP_FILE)
153+
154+
## Console
129155
os.system('pyinstaller '
130156
'--clean '
131-
'--distpath=%s ' % WIN_DIR +
157+
'-n %s ' % obtain_exe_filename(console=True) +
158+
'--distpath=%s ' % DIST_DIR +
132159
'--workpath=%s ' % WORK_DIR +
133160
'--specpath=%s ' % WIN_DIR +
134161
'--upx-dir=%s ' % BASE_DIR +
135162
'--icon=%s ' % WIN_ICON_FILE +
136163
'--version-file=%s ' % VERSION_FILE +
137-
# '--windowed '
138164
'--noconfirm ' + APP_FILE)
139165

140166
return True
@@ -146,7 +172,7 @@ def mac_pyinstaller():
146172
try:
147173
os.system('pyinstaller '
148174
'--clean '
149-
'--distpath=%s ' % MAC_DIR +
175+
'--distpath=%s ' % DIST_DIR +
150176
'--workpath=%s ' % MAC_WORK_DIR +
151177
'--specpath=%s ' % MAC_DIR +
152178
'--upx-dir=%s ' % BASE_DIR +
@@ -183,9 +209,9 @@ def run_inno():
183209
os.system(INNO_EXECUTABLE + " " + INNO_SCRIPT)
184210

185211
def run_no_installer():
186-
# pass
187-
filename = "{app}_{version}_{os}_{arch}_{type}.zip".format(app=data.app_name,
188-
version=data.version, os=sys.platform, arch='x86_64', type="No_Install")
212+
# Need to finish, Not functional
213+
raise ("Not functional yet")
214+
filename = obtain_exe_filename()
189215

190216
zipdir(os.path.join('odmtools'), filename)
191217
move_to_dist(filename)

setup/Windows/odmtools_console.iss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ODMTools"
5+
#define MyAppVersion "1.2.0_Beta"
6+
#define MyAppPublisher "ODM2"
7+
#define MyAppURL "https://github.com/ODM2/ODMToolsPython"
8+
#define MyAppExeName "ODMTools_1.2.0_Beta_win32_x86_64_console.exe"
9+
#define MyAppDir "C:\Users\jmeline_\Documents\GitHub\ODMToolsPython"
10+
11+
[Setup]
12+
; NOTE: The value of AppId uniquely identifies this application.
13+
; Do not use the same AppId value in installers for other applications.
14+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
15+
AppId={{4E5EC22A-DDE2-40A1-BCF5-5595BE768847}
16+
AppName={#MyAppName}
17+
AppVersion={#MyAppVersion}
18+
;AppVerName={#MyAppName} {#MyAppVersion}
19+
AppPublisher={#MyAppPublisher}
20+
AppPublisherURL={#MyAppURL}
21+
AppSupportURL={#MyAppURL}
22+
AppUpdatesURL={#MyAppURL}
23+
DefaultDirName={pf}\{#MyAppName}
24+
DefaultGroupName={#MyAppName}
25+
LicenseFile={#MyAppDir}\LICENSE.txt
26+
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Console_Installer
27+
SetupIconFile={#MyAppDir}\odmtools\common\icons\ODMTools.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
OutputDir={#MyAppDir}\setup\Dist
31+
UsePreviousAppDir=no
32+
33+
[Languages]
34+
Name: "english"; MessagesFile: "compiler:Default.isl"
35+
36+
[Tasks]
37+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
38+
39+
[Files]
40+
Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64_console\ODMTools_1.2.0_Beta_win32_x86_64_console.exe"; DestDir: "{app}"; Flags: ignoreversion
41+
Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64_console\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
42+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
43+
44+
[Icons]
45+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
46+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
47+
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
48+
49+
[Run]
50+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
51+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ODMTools"
5+
#define MyAppVersion "1.2.0_Beta"
6+
#define MyAppPublisher "ODM2"
7+
#define MyAppURL "https://github.com/ODM2/ODMToolsPython"
8+
#define MyAppExeName "ODMTools_1.2.0_Beta_win32_x86_64.exe"
9+
#define MyAppDir "C:\Users\jmeline_\Documents\GitHub\ODMToolsPython"
10+
11+
[Setup]
12+
; NOTE: The value of AppId uniquely identifies this application.
13+
; Do not use the same AppId value in installers for other applications.
14+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
15+
AppId={{2ABE254B-39DB-4EE2-AD7D-6BFBC7AA9182}
16+
AppName={#MyAppName}
17+
AppVersion={#MyAppVersion}
18+
;AppVerName={#MyAppName} {#MyAppVersion}
19+
AppPublisher={#MyAppPublisher}
20+
AppPublisherURL={#MyAppURL}
21+
AppSupportURL={#MyAppURL}
22+
AppUpdatesURL={#MyAppURL}
23+
DefaultDirName={pf}\{#MyAppName}
24+
DefaultGroupName={#MyAppName}
25+
LicenseFile={#MyAppDir}\LICENSE.txt
26+
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Installer
27+
SetupIconFile={#MyAppDir}\odmtools\common\icons\ODMTools.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
OutputDir={#MyAppDir}\setup\Dist
31+
UsePreviousAppDir=no
32+
33+
[Languages]
34+
Name: "english"; MessagesFile: "compiler:Default.isl"
35+
36+
[Tasks]
37+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
38+
39+
[Files]
40+
Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64\ODMTools_1.2.0_Beta_win32_x86_64.exe"; DestDir: "{app}"; Flags: ignoreversion
41+
Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
42+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
43+
44+
[Icons]
45+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
46+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
47+
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
48+
49+
[Run]
50+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
51+

setup/Windows/odmtools_setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Installer
2727
SetupIconFile={#MyAppDir}\odmtools\common\icons\ODMTools.ico
2828
Compression=lzma
2929
SolidCompression=yes
30-
OutputDir={#MyAppDir}\setup\Windows
30+
OutputDir={#MyAppDir}\setup\Dist
3131
UsePreviousAppDir=no
3232

3333
[Languages]

setup/Windows/test.iss

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ODMTools"
5+
#define MyAppVersion "1.2.0"
6+
#define MyAppPublisher "My Company, Inc."
7+
#define MyAppURL "http://www.example.com/"
8+
#define MyAppExeName "ODMTools_console.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application.
12+
; Do not use the same AppId value in installers for other applications.
13+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
14+
AppId={{272C80B3-2C07-49BE-B57D-1CB5A0952192}
15+
AppName={#MyAppName}
16+
AppVersion={#MyAppVersion}
17+
;AppVerName={#MyAppName} {#MyAppVersion}
18+
AppPublisher={#MyAppPublisher}
19+
AppPublisherURL={#MyAppURL}
20+
AppSupportURL={#MyAppURL}
21+
AppUpdatesURL={#MyAppURL}
22+
DefaultDirName={pf}\ODMTools_Console_AppFolderName
23+
DefaultGroupName=ODMTools_AppStartMenuFolderName
24+
OutputDir=CustomCompilerOutputFolder
25+
OutputBaseFilename=CompilerOutputBaseFileName
26+
Compression=lzma
27+
SolidCompression=yes
28+
29+
[Languages]
30+
Name: "english"; MessagesFile: "compiler:Default.isl"
31+
32+
[Tasks]
33+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
34+
35+
[Files]
36+
Source: "C:\Users\jmeline_\Documents\GitHub\ODMToolsPython\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64_console\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
37+
Source: "C:\Users\jmeline_\Documents\GitHub\ODMToolsPython\setup\Dist\ODMTools_1.2.0_Beta_win32_x86_64_console\ODMTools_1.2.0_Beta_win32_x86_64_console.exe"; DestDir: "{app}"; Flags: ignoreversion
38+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
39+
40+
[Icons]
41+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
42+
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
43+
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
44+
45+
[Run]
46+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
47+

0 commit comments

Comments
 (0)