Merge pull request #518 from Rafostar/win-installer

Provide Windows installer
This commit is contained in:
Rafał Dzięgiel
2025-01-18 11:50:42 +01:00
committed by GitHub
11 changed files with 202 additions and 2 deletions

View File

@@ -82,9 +82,20 @@ jobs:
find $BUILD_PREFIX/lib/clapper-0.0/ -name '*\.dll' -type f -exec ldd "{}" \; | grep '\/mingw.*\.dll' -o | xargs -I{} cp -n "{}" $BUILD_PREFIX/bin
find $BUILD_PREFIX/lib/gstreamer-1.0/ -name '*\.dll' -type f -exec ldd "{}" \; | grep '\/mingw.*\.dll' -o | xargs -I{} cp -n "{}" $BUILD_PREFIX/bin
find $BUILD_PREFIX/lib/gio/ -name '*\.dll' -type f -exec ldd "{}" \; | grep '\/mingw.*\.dll' -o | xargs -I{} cp -n "{}" $BUILD_PREFIX/bin
- name: Cleanup
run: |
BUILD_PREFIX="$GITHUB_WORKSPACE/clapper-win-${{ matrix.arch }}"
rm -rf $BUILD_PREFIX/include
rm -rf $BUILD_PREFIX/lib/pkgconfig
- name: Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.5
with:
path: builddir/pkgs/windows-installer/clapper.iss
options: /O+
- name: Upload
uses: actions/upload-artifact@v4
with:
name: clapper-win-${{ matrix.arch }}
path: clapper-win-${{ matrix.arch }}
path: builddir/pkgs/windows-installer/InstallerOutput/Clapper*.exe
if-no-files-found: error

View File

@@ -130,6 +130,7 @@ endif
subdir('src')
subdir('doc')
subdir('pkgs')
meson.add_devenv(devenv)

5
pkgs/meson.build Normal file
View File

@@ -0,0 +1,5 @@
is_windows = ['windows'].contains(host_machine.system())
if is_windows
subdir('windows-installer')
endif

View 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@

View 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,
)

View File

@@ -61,9 +61,10 @@ clapper_app_utils_win_enforce_hi_res_clock (void)
{
#ifdef HAVE_WIN_PROCESS_THREADS_API
PROCESS_POWER_THROTTLING_STATE PowerThrottling;
RtlZeroMemory (&PowerThrottling, sizeof (PowerThrottling));
gboolean success;
RtlZeroMemory (&PowerThrottling, sizeof (PowerThrottling));
PowerThrottling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;
PowerThrottling.ControlMask = PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION;
PowerThrottling.StateMask = 0; // Always honor timer resolution requests

View File

@@ -94,6 +94,7 @@ if is_windows
clapperapp_deps += winmm_dep
clapperapp_c_args += ['-DHAVE_WIN_TIME_API']
endif
subdir('windows')
endif
executable(

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<dependency>
<dependentAssembly>
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -0,0 +1,56 @@
/* Clapper Application
* Copyright (C) 2024 Rafał Dzięgiel <rafostar.github@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <windows.h>
#define VER_CLAPPERVERSION @VER_CLAPPERVERSION@
#define VER_NONE 0x0L
MAIN_ICON ICON "clapper.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_CLAPPERVERSION
PRODUCTVERSION VER_CLAPPERVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS VER_NONE
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VER_NONE
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Rafostar"
VALUE "FileDescription", @CLAPPER_APP_NAME@
VALUE "FileVersion", @PACKAGE_VERSION@
VALUE "InternalName", @PACKAGE@
VALUE "LegalCopyright", "Copyright (C) Rafal Dziegiel"
VALUE "OriginalFilename", @CLAPPER_EXE@
VALUE "ProductName", @CLAPPER_APP_NAME@
VALUE "ProductVersion", @PACKAGE_VERSION@
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#ifdef __MINGW32__
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "clapper.exe.manifest"
#endif

View File

@@ -0,0 +1,20 @@
rc_conf = configuration_data()
rc_conf.set('VER_CLAPPERVERSION', clapper_version.replace('.', ',') + ',0')
rc_conf.set_quoted('PACKAGE', meson.project_name())
rc_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
rc_conf.set_quoted('PACKAGE_ORIGIN', 'https://github.com/Rafostar/clapper')
rc_conf.set_quoted('CLAPPER_APP_NAME', 'Clapper')
rc_conf.set_quoted('CLAPPER_EXE', meson.project_name() + '.exe')
clapperapp_rc = configure_file(
input: 'clapper.rc.in',
output: 'clapper.rc',
configuration: rc_conf,
)
windres = find_program('windres', required: true)
clapperapp_sources += custom_target('clapper.o',
input: clapperapp_rc,
output: 'clapper.o',
command: [windres, '-I', '@CURRENT_SOURCE_DIR@', '-o', '@OUTPUT@', '@INPUT@']
)