mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 15:22:11 +02:00
pkgs: Generate Inno Setup based Windows installer
This commit is contained in:
@@ -130,6 +130,7 @@ endif
|
||||
|
||||
subdir('src')
|
||||
subdir('doc')
|
||||
subdir('pkgs')
|
||||
|
||||
meson.add_devenv(devenv)
|
||||
|
||||
|
5
pkgs/meson.build
Normal file
5
pkgs/meson.build
Normal file
@@ -0,0 +1,5 @@
|
||||
is_windows = ['windows'].contains(host_machine.system())
|
||||
|
||||
if is_windows
|
||||
subdir('windows-installer')
|
||||
endif
|
31
pkgs/windows-installer/clapper.iss.in
Normal file
31
pkgs/windows-installer/clapper.iss.in
Normal file
@@ -0,0 +1,31 @@
|
||||
[Setup]
|
||||
AppName=Clapper
|
||||
AppVersion=@CLAPPER_APP_VERSION@
|
||||
AppVerName=Clapper @CLAPPER_APP_VERSION@
|
||||
VersionInfoVersion=@CLAPPER_APP_VERSION@.0
|
||||
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@
|
44
pkgs/windows-installer/meson.build
Normal file
44
pkgs/windows-installer/meson.build
Normal file
@@ -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,
|
||||
)
|
Reference in New Issue
Block a user