-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkgs: Generate Inno Setup based Windows installer
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,6 +130,7 @@ endif | |
|
||
subdir('src') | ||
subdir('doc') | ||
subdir('pkgs') | ||
|
||
meson.add_devenv(devenv) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
is_windows = ['windows'].contains(host_machine.system()) | ||
|
||
if is_windows | ||
subdir('windows-installer') | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[Setup] | ||
AppName=Clapper | ||
AppVersion=@CLAPPER_APP_VERSION@ | ||
AppVerName=Clapper @CLAPPER_APP_VERSION@ | ||
VersionInfoVersion=@[email protected] | ||
ArchitecturesAllowed=x64compatible | ||
ArchitecturesInstallIn64BitMode=x64compatible | ||
WizardStyle=modern | ||
DefaultDirName={autopf}\Clapper | ||
DefaultGroupName=Clapper | ||
DisableProgramGroupPage=yes | ||
ChangesAssociations=yes | ||
Compression=lzma2 | ||
SolidCompression=yes | ||
OutputDir=InstallerOutput | ||
OutputBaseFilename=Clapper_@CLAPPER_APP_VERSION@ | ||
SetupIconFile=@PROJECT_ROOT@\src\bin\clapper-app\windows\clapper.ico | ||
LicenseFile=@PROJECT_ROOT@\COPYING-GPL | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
|
||
[Files] | ||
Source: "@CLAPPER_APP_DEST@\*"; DestDir: "{app}"; Flags: recursesubdirs replacesameversion | ||
|
||
[Icons] | ||
Name: "{autoprograms}\Clapper"; Filename: "{app}\bin\clapper.exe" | ||
Name: "{autodesktop}\Clapper"; Filename: "{app}\bin\clapper.exe"; Tasks: desktopicon | ||
|
||
[Registry] | ||
@CLAPPER_APP_REG_ENTRIES@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Same as "clapper-app-utils.c" | ||
# FIXME: Have these in one place only | ||
win_extensions = [ | ||
'avi', 'claps', 'm2ts', 'mkv', 'mov', | ||
'mp4', 'webm', 'wmv' | ||
] | ||
reg_entries = [] | ||
|
||
foreach ext : win_extensions | ||
ext_id = 'Clapper.' + ext | ||
exe_path = '{app}\\bin\\clapper.exe' | ||
|
||
subkey = 'Software\\Classes\\.' + ext + '\\OpenWithProgids' | ||
reg_entries += 'Root: HKA; Subkey: "@0@"; ValueType: string; ValueName: "@1@"; ValueData: ""; Flags: uninsdeletevalue'.format(subkey, ext_id) | ||
|
||
subkey = 'Software\\Classes\\' + ext_id | ||
reg_entries += 'Root: HKA; Subkey: "@0@"; ValueType: string; ValueName: ""; ValueData: "@1@"; Flags: uninsdeletekey'.format(subkey, ext) | ||
|
||
subkey = 'Software\\Classes\\' + ext_id + '\\DefaultIcon' | ||
reg_entries += 'Root: HKA; Subkey: "@0@"; ValueType: string; ValueName: ""; ValueData: "@1@,0"'.format(subkey, exe_path) | ||
|
||
subkey = 'Software\\Classes\\' + ext_id + '\\shell\\open\\command' | ||
reg_entries += 'Root: HKA; Subkey: "@0@"; ValueType: string; ValueName: ""; ValueData: """@1@"" ""%1"""'.format(subkey, exe_path) | ||
|
||
reg_entries += '' # Empty line for clarity | ||
endforeach | ||
|
||
# NOTE: In meson replacing "@@" vars after "\" sign does not work. | ||
# For this reason we do not pass app name here. | ||
iss_conf = configuration_data() | ||
iss_conf.set('CLAPPER_APP_VERSION', meson.project_version()) | ||
iss_conf.set('CLAPPER_APP_REG_ENTRIES', '\n'.join(reg_entries)) | ||
iss_conf.set('PROJECT_ROOT', meson.project_source_root()) | ||
|
||
# NOTE: We also need to package other dependencies, hence using whole prefix. | ||
# Workaround to reduce package size is to set prefix to some custom dir, install, | ||
# then determine the rest with "ldd" and copy remaining files manually there. | ||
iss_conf.set('CLAPPER_APP_DEST', prefix.replace('/', '\\')) | ||
|
||
configure_file( | ||
input: 'clapper.iss.in', | ||
output: 'clapper.iss', | ||
configuration: iss_conf, | ||
) |