Skip to content

Commit

Permalink
Merge pull request #22 from sidecuter/dev
Browse files Browse the repository at this point in the history
Windows fixes
  • Loading branch information
sidecuter committed Dec 29, 2023
2 parents 70ce3db + f7954b5 commit 5f2f172
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Github release

on:
push:
tags:
- "v*.*.*"
branches:
- master

jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
steps:
- uses: msys2/setup-msys2@v2
Expand All @@ -28,7 +29,7 @@ jobs:
uses: actions/checkout@v3
- name: Setup project
shell: msys2 {0}
run: meson setup build --prefix=$(pwd)/install --buildtype=release --optimization=3
run: meson setup build --prefix="C:/Program Files (x86)/Gciphers" --buildtype=release
- name: Compile project
shell: msys2 {0}
run: meson compile -C build
Expand All @@ -40,9 +41,13 @@ jobs:
run: meson install -C build
- name: Build package
shell: msys2 {0}
run: makensis install/gciphers.nsi
run: makensis "C:/Program Files (x86)/Gciphers/gciphers.nsi"
- name: Clear build artifacts
shell: msys2 {0}
run: |
rm -rf "C:/Program Files (x86)/Gciphers"
rm -rf build
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: gciphers.exe
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gciphers_deps = [
]

if host_machine.system() == 'windows'
subdir('windows')
subdir('windows')
endif

executable(
Expand Down
2 changes: 1 addition & 1 deletion windows/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ gciphers_sources += windows.compile_resources(
join_paths(meson.current_build_dir(), 'version.rc'),
)

meson.add_install_script('./post_install.py')
meson.add_install_script('post_install.py')
15 changes: 5 additions & 10 deletions windows/post_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import shutil
import functools
import json


def print_wrapper(message="Base"):
Expand Down Expand Up @@ -44,8 +43,8 @@ class DepsFinder():
def find_msys_deps(self, target: str, depth: int = 0) -> None:
if depth == 0:
return
for line in os.popen(f"ntldd {target}"):
line = line.split()[2]
for line in os.popen(f'ntldd "{target}"'):
line = " ".join(line.split()[2:3])
if line == 'not':
continue
path: list[str] = line.split('\\')
Expand Down Expand Up @@ -173,15 +172,14 @@ def create_nsis_script():
!define APP_NAME "Gciphers"
!define COMP_NAME "Sidecuter"
!define WEB_SITE "https://github.com/sidecuter/gciphers"
!define VERSION "0.0.1.0"
!define VERSION "0.1.0.0"
!define COPYRIGHT "Sidecuter © 2023"
!define DESCRIPTION "Application"
!define LICENSE_TXT "{SOURCE_ROOT}\\LICENSE"
!define INSTALLER_NAME "{SOURCE_ROOT}\\gciphers.exe"
!define MAIN_APP_EXE "bin\\com.github.sidecuter.gciphers.exe"
!define INSTALL_TYPE "SetShellVarContext all"
!define REG_ROOT "HKLM"
''')
!define REG_ROOT "HKLM"''')
file.write('''
!define REG_APP_PATH "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\${MAIN_APP_EXE}"
!define UNINSTALL_PATH "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${APP_NAME}"
Expand All @@ -205,9 +203,8 @@ def create_nsis_script():
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES\\Gciphers"
InstallDir "C:\\Program Files (x86)\\Gciphers"
######################################################################
Expand All @@ -226,8 +223,6 @@ def create_nsis_script():
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif
!insertmacro MUI_PAGE_DIRECTORY
!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Gciphers"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
Expand Down

0 comments on commit 5f2f172

Please sign in to comment.