diff --git a/meson.build b/meson.build index 236e203e..7c0bf97f 100644 --- a/meson.build +++ b/meson.build @@ -85,6 +85,10 @@ subdir('po') subdir('data') subdir('src') +if windows_build + subdir('windows') +endif + gnome.post_install( glib_compile_schemas: true, gtk_update_icon_cache: true, diff --git a/windows/Jorts-Installer.exe b/windows/Jorts-Installer.exe deleted file mode 100644 index 3c4de117..00000000 Binary files a/windows/Jorts-Installer.exe and /dev/null differ diff --git a/windows/deploy.sh b/windows/deploy.sh deleted file mode 100644 index b9c1ba65..00000000 --- a/windows/deploy.sh +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/bash - -# Script to go all the way from building to compiling to creating an installer -# Install MSYS2 then run prep.sh before this to prep your box -# Very tweaked version of the deploy.sh from SuperCamel: https://github.com/supercamel/ValaOnWindows - -# Run this from base directory, not ./windows - -# Run the exe of your app in deploy/bin : -# From the MSYS2 console to check you have all packages necessary for it to run on windows -# From windows Explorer by double-click to check if everything it needs is in the deploy folder -# Copy stuff from /c/MSYS2/mingw64/ everything needed should be kinda there - -#-------------------------------- -# Variables. -# Write path UNIX-style ("/"). Script will invert the slash where relevant. -app_name="Jorts" -build_dir="builddir" -theme_name="io.elementary.stylesheet.blueberry" -icon_theme="elementary" -version="$(cat meson.build | grep version | cut -d \' -f 2)" -publisher="elly-code" - -deploy_dir="windows/deploy" -exe_name="io.github.elly_code.jorts.exe" - -#-------------------------------- -# Rebuild and compile the exe as a release build -rm -rfd ${build_dir} -meson setup --buildtype release ${build_dir} -ninja -C ${build_dir} - -#-------------------------------- -# Prepare structure -mkdir -p "${deploy_dir}" -mkdir -p "${deploy_dir}/bin" -mkdir -p "${deploy_dir}/etc" -mkdir -p "${deploy_dir}/share" -mkdir -p "${deploy_dir}/lib" -mkdir -p "${deploy_dir}/include" - -cp "${build_dir}/src/${exe_name}" "${deploy_dir}/bin" -cp -r "windows/icons" "${deploy_dir}" - -# Detect what DLL we need and slorp it into bin -echo "Copying DLLs..." -dlls=$(ldd "${deploy_dir}/bin/${exe_name}" | grep "/mingw64" | awk '{print $3}') -for dll in $dlls -do - cp "$dll" "${deploy_dir}/bin" -done - -# These are not detected but needed to display icons properly -# Dont ask me how many tears of blood it took to figure out these idiots -cp -rnv /mingw64/bin/rsvg-convert.exe ${deploy_dir}/bin/ -cp -rnv /mingw64/bin/librsvg-2-2.dll ${deploy_dir}/bin/ -cp -rnv /mingw64/bin/libxml2-16.dll ${deploy_dir}/bin/ - -# Copy other required things for Gtk to work nicely -echo "Copying other necessary files..." -cp -nv /mingw64/bin/gdbus.exe ${deploy_dir}/bin/ -cp -rnv /mingw64/etc/fonts ${deploy_dir}/etc/ -cp -rnv /mingw64/share/glib-2.0 ${deploy_dir}/share/ -cp -rnv /mingw64/share/gtk-4.0 ${deploy_dir}/share/ -cp -rnv /mingw64/share/locale ${deploy_dir}/share/ -cp -rnv /mingw64/share/themes/ ${deploy_dir}/share/ -cp -rnv /mingw64/share/gettext/ ${deploy_dir}/share/ -cp -rnv /mingw64/share/fontconfig/ ${deploy_dir}/share/ -cp -rnv /mingw64/share/GConf/ ${deploy_dir}/share/ -cp -rnv /mingw64/lib/gettext/ ${deploy_dir}/lib/ - -# We need this to properly display icons too. -cp -rnv /mingw64/include/librsvg-2.0 ${deploy_dir}/include/ -cp -rnv /mingw64/lib/gdk-pixbuf-2.0/ ${deploy_dir}/lib/ -#export GDK_PIXBUF_MODULEDIR=lib/gdk-pixbuf-2.0/2.10.0/loaders -#gdk-pixbuf-query-loaders > ${deploy_dir}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache - -# Make sure this one is actually copied, manually, in the deploy -# That file caused so many issues trying to build -cat windows/loaders.cache > ${deploy_dir}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache - -#-------------------------------- -# ICONS. Only what we need. Shits heavy af -# Honestly you could get away with copying the whole icon theme. The script goes into the weeds only to shave off MBs -# TODO: No matter what, the edit-find icon in the searchfield of emoji-popover shows as missing -# TODO: Abstract this into a script. A better coded one. -mkdir -pv ${deploy_dir}/share/icons/elementary - -cp -rnv /mingw64/share/icons/elementary/actions* ${deploy_dir}/share/icons/elementary/ -cp -rnv /mingw64/share/icons/elementary/status* ${deploy_dir}/share/icons/elementary/ -cp -rnv /mingw64/share/icons/elementary/emotes* ${deploy_dir}/share/icons/elementary/ -cp -rnv /mingw64/share/icons/elementary/index.theme ${deploy_dir}/share/icons/elementary/ -gtk4-update-icon-cache.exe -f ${deploy_dir}/share/icons/elementary/ - -#-------------------------------- -# Write the theme to gtk settings -# The NSIS below handles installing the font, as it works differently on windows - -mkdir -v ${deploy_dir}/etc/gtk-4.0/ -cat << EOF > ${deploy_dir}/etc/gtk-4.0/settings.ini -[Settings] -gtk-theme-name=${theme_name} -gtk-icon-theme-name=${icon_theme} -gtk-font-name=Inter Variable Text 9 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintful -gtk-xft-rgba=rgb -EOF - -glib-compile-schemas ${deploy_dir}/share/glib-2.0/schemas - -#================================================================ -# Create NSIS script -echo "Creating NSIS script..." -cat << EOF > windows/${app_name}-Installer.nsi -!include "MUI2.nsh" -!include WinMessages.nsh - -Name ${app_name} - -VIAddVersionKey /LANG=0 "ProductName" "${app_name}" -VIAddVersionKey /LANG=0 "FileVersion" "${version}" -VIAddVersionKey /LANG=0 "ProductVersion" "${version}" -VIAddVersionKey /LANG=0 "FileDescription" "https://github.com/elly-code/jorts" -VIAddVersionKey /LANG=0 "LegalCopyright" "GNU GPL v3 elly-code" -VIProductVersion "${version}.0" - -Outfile "${app_name}-Installer.exe" -InstallDir "\$LOCALAPPDATA\\Programs\\${app_name}" - -# RequestExecutionLevel admin ; Request administrative privileges -RequestExecutionLevel user - -# Set the title of the installer window -Caption "${app_name} Installer" -BrandingText "Jorts ${version}, ${publisher} 2025" - -# Set the title and text on the welcome page -!define MUI_WELCOMEPAGE_TITLE "Welcome to ${app_name} setup" -!define MUI_WELCOMEPAGE_TEXT "This bitch will guide you through the installation of ${app_name}." -!define MUI_INSTFILESPAGE_TEXT "Please wait while ${app_name} is being installed." -!define MUI_ICON "icons\install.ico" -!define MUI_UNICON "icons\uninstall.ico" - -!define MUI_FINISHPAGE_LINK "Source code and wiki" -!define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/elly-code/jorts" -!define MUI_FINISHPAGE_RUN "\$INSTDIR\bin\io.github.elly_code.jorts.exe" - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!insertmacro MUI_UNPAGE_FINISH - -!insertmacro MUI_LANGUAGE "English" - -!macro GetCleanDir INPUTDIR - ; ATTENTION: USE ON YOUR OWN RISK! - ; Please report bugs here: http://stefan.bertels.org/ - !define Index_GetCleanDir 'GetCleanDir_Line\${__LINE__}' - Push \$R0 - Push \$R1 - StrCpy \$R0 "\${INPUTDIR}" - StrCmp \$R0 "" \${Index_GetCleanDir}-finish - StrCpy \$R1 "\$R0" "" -1 - StrCmp "\$R1" "\" \${Index_GetCleanDir}-finish - StrCpy \$R0 "\$R0\" -\${Index_GetCleanDir}-finish: - Pop \$R1 - Exch \$R0 - !undef Index_GetCleanDir -!macroend - -; ################################################################ -; similar to "RMDIR /r DIRECTORY", but does not remove DIRECTORY itself -; example: !insertmacro RemoveFilesAndSubDirs "\$INSTDIR" -!macro RemoveFilesAndSubDirs DIRECTORY - ; ATTENTION: USE ON YOUR OWN RISK! - ; Please report bugs here: http://stefan.bertels.org/ - !define Index_RemoveFilesAndSubDirs 'RemoveFilesAndSubDirs_\${__LINE__}' - - Push \$R0 - Push \$R1 - Push \$R2 - - !insertmacro GetCleanDir "\${DIRECTORY}" - Pop \$R2 - FindFirst \$R0 \$R1 "\$R2*.*" -\${Index_RemoveFilesAndSubDirs}-loop: - StrCmp \$R1 "" \${Index_RemoveFilesAndSubDirs}-done - StrCmp \$R1 "." \${Index_RemoveFilesAndSubDirs}-next - StrCmp \$R1 ".." \${Index_RemoveFilesAndSubDirs}-next - IfFileExists "\$R2\$R1\*.*" \${Index_RemoveFilesAndSubDirs}-directory - ; file - Delete "\$R2\$R1" - goto \${Index_RemoveFilesAndSubDirs}-next -\${Index_RemoveFilesAndSubDirs}-directory: - ; directory - RMDir /r "\$R2\$R1" -\${Index_RemoveFilesAndSubDirs}-next: - FindNext \$R0 \$R1 - Goto \${Index_RemoveFilesAndSubDirs}-loop -\${Index_RemoveFilesAndSubDirs}-done: - FindClose \$R0 - - Pop \$R2 - Pop \$R1 - Pop \$R0 - !undef Index_RemoveFilesAndSubDirs -!macroend - -Section "Install" - SetOutPath "\$INSTDIR" - File /r "deploy\\*" - CreateDirectory \$SMPROGRAMS\\${app_name} - - ; fonts. We install to local fonts to not trip up admin rights, and register for local user - SetOutPath "\$LOCALAPPDATA\\Microsoft\\Windows\\Fonts" - File /r "fonts\\*" - WriteRegStr HKCU "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" "Redacted Script Regular (TrueType)" "\$LOCALAPPDATA\\Microsoft\\Windows\\Fonts\\RedactedScript-Regular.ttf" - WriteRegStr HKCU "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" "Inter (TrueType)" "\$LOCALAPPDATA\\Microsoft\\Windows\\Fonts\\InterVariable.ttf" - SetOutPath "\$INSTDIR" - - ; Start menu - CreateShortCut "\$SMPROGRAMS\\${app_name}\\${app_name}.lnk" "\$INSTDIR\\bin\\${exe_name}" "" "\$INSTDIR\\icons\\icon-mini.ico" 0 - - ; Autostart - CreateShortCut "\$SMPROGRAMS\\Startup\\${app_name}.lnk" "\$INSTDIR\\bin\\${exe_name}" "" "\$INSTDIR\\icons\\icon-mini.ico" 0 - - ; Preferences - CreateShortCut "\$SMPROGRAMS\\${app_name}\\Preferences of ${app_name}.lnk" "\$INSTDIR\bin\\${exe_name}" "--preferences" "\$INSTDIR\\icons\\settings-mini.ico" 0 - - WriteRegStr HKCU "Software\\${app_name}" "" \$INSTDIR - WriteUninstaller "\$INSTDIR\Uninstall.exe" - - ; Add to Add/Remove programs list - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "DisplayName" "${app_name}" - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "DisplayIcon" "\$INSTDIR\\icons\\icon.ico" - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "InstallLocation" "\$INSTDIR\\" - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "UninstallString" "\$INSTDIR\\Uninstall.exe" - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "Publisher" "${publisher}" - WriteRegStr HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "URLInfoAbout" "https://github.com/elly-code/jorts" - WriteRegDWORD HKCU "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${app_name}" "EstimatedSize" "0x00028294" ;164,5 MB -SectionEnd - -Section "Uninstall" - - ; Remove Start Menu shortcut - Delete "\$SMPROGRAMS\\${app_name}\\${app_name}.lnk" - Delete "\$SMPROGRAMS\\${app_name}\\Preferences of ${app_name}.lnk" - Delete "\$SMPROGRAMS\\Startup\\${app_name}.lnk" - - ; Remove uninstaller - Delete "\$INSTDIR\Uninstall.exe" - - ; Remove files and folders - !insertmacro RemoveFilesAndSubDirs "\$INSTDIR" - - ; Remove directories used - RMDir \$SMPROGRAMS\\${app_name} - RMDir "\$INSTDIR" - - ; Remove font - Delete "\$LOCALAPPDATA\\Microsoft\\Windows\\Fonts\\RedactedScript-Regular.ttf" - DeleteRegKey HKCU "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\Redacted Script Regular (TrueType)" - Delete "\$LOCALAPPDATA\\Microsoft\\Windows\\Fonts\\InterVariable.ttf" - DeleteRegKey HKCU "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\Inter Variable (TrueType)" - - ; Remove registry keys - DeleteRegKey HKCU "Software\\${app_name}" - DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\\${app_name}" - -SectionEnd - -EOF - - -#-------------------------------- -# Build the final exe installer. -# Test out the deploy bin just in case though. - -echo "Running NSIS..." -makensis windows/${app_name}-Installer.nsi - -echo "Done" - diff --git a/windows/deploy.sh.in b/windows/deploy.sh.in new file mode 100644 index 00000000..c4f60f89 --- /dev/null +++ b/windows/deploy.sh.in @@ -0,0 +1,120 @@ +#!/bin/bash + +# Script to go all the way from building to compiling to creating an installer +# Install MSYS2 then run prep.sh before this to prep your box +# Very tweaked version of the deploy.sh from SuperCamel: https://github.com/supercamel/ValaOnWindows + +# Run this from base directory, not ./windows + +# Run the exe of your app in deploy/bin : +# From the MSYS2 console to check you have all packages necessary for it to run on windows +# From windows Explorer by double-click to check if everything it needs is in the deploy folder +# Copy stuff from /c/MSYS2/mingw64/ everything needed should be kinda there + +#-------------------------------- +# Variables. +# Write path UNIX-style ("/"). Script will invert the slash where relevant. +app_name="@APP_NAME@" +build_dir="builddir" +theme_name="io.elementary.stylesheet.blueberry" +icon_theme="elementary" +version="@APP_VERSION@" +publisher="elly-code" + +deploy_dir="windows/deploy" +exe_name="@APP_ID@.exe" + +#-------------------------------- +# Rebuild and compile the exe as a release build +meson setup --buildtype release ${build_dir} --reconfigure +ninja -C ${build_dir} + +#-------------------------------- +# Prepare structure +mkdir -p "${deploy_dir}" +mkdir -p "${deploy_dir}/bin" +mkdir -p "${deploy_dir}/etc" +mkdir -p "${deploy_dir}/share" +mkdir -p "${deploy_dir}/lib" +mkdir -p "${deploy_dir}/include" + +cp "${build_dir}/src/${exe_name}" "${deploy_dir}/bin" +cp -r "windows/icons" "${deploy_dir}" + +# Detect what DLL we need and slorp it into bin +echo "Copying DLLs..." +dlls=$(ldd "${deploy_dir}/bin/${exe_name}" | grep "/mingw64" | awk '{print $3}') +for dll in $dlls +do + cp "$dll" "${deploy_dir}/bin" +done + +# These are not detected but needed to display icons properly +# Dont ask me how many tears of blood it took to figure out these idiots +cp -rnv /mingw64/bin/rsvg-convert.exe ${deploy_dir}/bin/ +cp -rnv /mingw64/bin/librsvg-2-2.dll ${deploy_dir}/bin/ +cp -rnv /mingw64/bin/libxml2-16.dll ${deploy_dir}/bin/ + +# Copy other required things for Gtk to work nicely +echo "Copying other necessary files..." +cp -nv /mingw64/bin/gdbus.exe ${deploy_dir}/bin/ +cp -rnv /mingw64/etc/fonts ${deploy_dir}/etc/ +cp -rnv /mingw64/share/glib-2.0 ${deploy_dir}/share/ +cp -rnv /mingw64/share/gtk-4.0 ${deploy_dir}/share/ +cp -rnv /mingw64/share/locale ${deploy_dir}/share/ +cp -rnv /mingw64/share/themes/ ${deploy_dir}/share/ +cp -rnv /mingw64/share/gettext/ ${deploy_dir}/share/ +cp -rnv /mingw64/share/fontconfig/ ${deploy_dir}/share/ +cp -rnv /mingw64/share/GConf/ ${deploy_dir}/share/ +cp -rnv /mingw64/lib/gettext/ ${deploy_dir}/lib/ + +# We need this to properly display icons too. +cp -rnv /mingw64/include/librsvg-2.0 ${deploy_dir}/include/ +cp -rnv /mingw64/lib/gdk-pixbuf-2.0/ ${deploy_dir}/lib/ +#export GDK_PIXBUF_MODULEDIR=lib/gdk-pixbuf-2.0/2.10.0/loaders +#gdk-pixbuf-query-loaders > ${deploy_dir}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache + +# Make sure this one is actually copied, manually, in the deploy +# That file caused so many issues trying to build +cat windows/loaders.cache > ${deploy_dir}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache + +#-------------------------------- +# ICONS. Only what we need. Shits heavy af +# Honestly you could get away with copying the whole icon theme. The script goes into the weeds only to shave off MBs +# TODO: No matter what, the edit-find icon in the searchfield of emoji-popover shows as missing +# TODO: Abstract this into a script. A better coded one. +mkdir -pv ${deploy_dir}/share/icons/elementary + +cp -rnv /mingw64/share/icons/elementary/actions* ${deploy_dir}/share/icons/elementary/ +cp -rnv /mingw64/share/icons/elementary/status* ${deploy_dir}/share/icons/elementary/ +cp -rnv /mingw64/share/icons/elementary/emotes* ${deploy_dir}/share/icons/elementary/ +cp -rnv /mingw64/share/icons/elementary/index.theme ${deploy_dir}/share/icons/elementary/ +gtk4-update-icon-cache.exe -f ${deploy_dir}/share/icons/elementary/ + +#-------------------------------- +# Write the theme to gtk settings +# The NSIS below handles installing the font, as it works differently on windows + +mkdir -v ${deploy_dir}/etc/gtk-4.0/ +cat << EOF > ${deploy_dir}/etc/gtk-4.0/settings.ini +[Settings] +gtk-theme-name=${theme_name} +gtk-icon-theme-name=${icon_theme} +gtk-font-name=Inter Variable Text 9 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintful +gtk-xft-rgba=rgb +EOF + +glib-compile-schemas ${deploy_dir}/share/glib-2.0/schemas + +#-------------------------------- +# Build the final exe installer. +# Test out the deploy bin just in case though. + +echo "Running NSIS..." +makensis windows/${app_name}-installer.nsi + +echo "Done" + diff --git a/windows/fonts/InterVariable.ttf b/windows/fonts/InterVariable.ttf deleted file mode 100644 index 4ab79e01..00000000 Binary files a/windows/fonts/InterVariable.ttf and /dev/null differ diff --git a/windows/fonts/RedactedScript-Regular.ttf b/windows/fonts/RedactedScript-Regular.ttf deleted file mode 100644 index 71c5f7e7..00000000 Binary files a/windows/fonts/RedactedScript-Regular.ttf and /dev/null differ diff --git a/windows/Jorts-Installer.nsi b/windows/installer.nsi.in similarity index 72% rename from windows/Jorts-Installer.nsi rename to windows/installer.nsi.in index b95445e0..e6619887 100644 --- a/windows/Jorts-Installer.nsi +++ b/windows/installer.nsi.in @@ -3,33 +3,33 @@ Name Jorts -VIAddVersionKey /LANG=0 "ProductName" "Jorts" -VIAddVersionKey /LANG=0 "FileVersion" "4.0.0" -VIAddVersionKey /LANG=0 "ProductVersion" "4.0.0" +VIAddVersionKey /LANG=0 "ProductName" "@APP_NAME@" +VIAddVersionKey /LANG=0 "FileVersion" "@APP_VERSION@" +VIAddVersionKey /LANG=0 "ProductVersion" "@APP_VERSION@" VIAddVersionKey /LANG=0 "FileDescription" "https://github.com/elly-code/jorts" VIAddVersionKey /LANG=0 "LegalCopyright" "GNU GPL v3 elly-code" -VIProductVersion "4.0.0.0" +VIProductVersion "@APP_VERSION@.0" Outfile "Jorts-Installer.exe" -InstallDir "$LOCALAPPDATA\Programs\Jorts" +InstallDir "$LOCALAPPDATA\Programs\@APP_ID@" # RequestExecutionLevel admin ; Request administrative privileges RequestExecutionLevel user # Set the title of the installer window Caption "Jorts Installer" -BrandingText "Jorts 4.0.0, elly-code 2025" +BrandingText "@APP_NAME@ @APP_VERSION@, elly-code 2026" # Set the title and text on the welcome page -!define MUI_WELCOMEPAGE_TITLE "Welcome to Jorts setup" -!define MUI_WELCOMEPAGE_TEXT "This bitch will guide you through the installation of Jorts." -!define MUI_INSTFILESPAGE_TEXT "Please wait while Jorts is being installed." +!define MUI_WELCOMEPAGE_TITLE "Welcome to @APP_NAME@ setup" +!define MUI_WELCOMEPAGE_TEXT "This bitch will guide you through the installation of @APP_NAME@." +!define MUI_INSTFILESPAGE_TEXT "Please wait while @APP_NAME@ is being installed." !define MUI_ICON "icons\install.ico" !define MUI_UNICON "icons\uninstall.ico" !define MUI_FINISHPAGE_LINK "Source code and wiki" !define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/elly-code/jorts" -!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\io.github.elly_code.jorts.exe" +!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\@APP_ID@.exe" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY @@ -99,43 +99,43 @@ ${Index_RemoveFilesAndSubDirs}-done: Section "Install" SetOutPath "$INSTDIR" File /r "deploy\*" - CreateDirectory $SMPROGRAMS\Jorts + CreateDirectory $SMPROGRAMS\@APP_NAME@ ; fonts. We install to local fonts to not trip up admin rights, and register for local user SetOutPath "$LOCALAPPDATA\Microsoft\Windows\Fonts" - File /r "fonts\*" + File /r "..\data\fonts\*" WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\Fonts" "Redacted Script Regular (TrueType)" "$LOCALAPPDATA\Microsoft\Windows\Fonts\RedactedScript-Regular.ttf" WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\Fonts" "Inter (TrueType)" "$LOCALAPPDATA\Microsoft\Windows\Fonts\InterVariable.ttf" SetOutPath "$INSTDIR" ; Start menu - CreateShortCut "$SMPROGRAMS\Jorts\Jorts.lnk" "$INSTDIR\bin\io.github.elly_code.jorts.exe" "" "$INSTDIR\icons\icon-mini.ico" 0 + CreateShortCut "$SMPROGRAMS\@APP_NAME@\@APP_NAME@.lnk" "$INSTDIR\bin\@APP_ID@.exe" "" "$INSTDIR\icons\icon-mini.ico" 0 ; Autostart - CreateShortCut "$SMPROGRAMS\Startup\Jorts.lnk" "$INSTDIR\bin\io.github.elly_code.jorts.exe" "" "$INSTDIR\icons\icon-mini.ico" 0 + CreateShortCut "$SMPROGRAMS\Startup\@APP_NAME@.lnk" "$INSTDIR\bin\@APP_ID@.exe" "" "$INSTDIR\icons\icon-mini.ico" 0 ; Preferences - CreateShortCut "$SMPROGRAMS\Jorts\Preferences of Jorts.lnk" "$INSTDIR\bin\io.github.elly_code.jorts.exe" "--preferences" "$INSTDIR\icons\settings-mini.ico" 0 + CreateShortCut "$SMPROGRAMS\@APP_NAME@\Preferences of @APP_NAME@.lnk" "$INSTDIR\bin\@APP_ID@.exe" "--preferences" "$INSTDIR\icons\settings-mini.ico" 0 - WriteRegStr HKCU "Software\Jorts" "" $INSTDIR + WriteRegStr HKCU "Software\@APP_ID@" "" $INSTDIR WriteUninstaller "$INSTDIR\Uninstall.exe" ; Add to Add/Remove programs list - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "DisplayName" "Jorts" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "DisplayIcon" "$INSTDIR\icons\icon.ico" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "InstallLocation" "$INSTDIR\" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "UninstallString" "$INSTDIR\Uninstall.exe" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "Publisher" "elly-code" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "URLInfoAbout" "https://github.com/elly-code/jorts" - WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "EstimatedSize" "0x00028294" ;164,5 MB + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "DisplayName" "@APP_NAME@" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "DisplayIcon" "$INSTDIR\icons\icon.ico" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "InstallLocation" "$INSTDIR\" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "UninstallString" "$INSTDIR\Uninstall.exe" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "Publisher" "elly-code" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "URLInfoAbout" "https://github.com/elly-code/jorts" + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" "EstimatedSize" "0x00028294" ;164,5 MB SectionEnd Section "Uninstall" ; Remove Start Menu shortcut - Delete "$SMPROGRAMS\Jorts\Jorts.lnk" - Delete "$SMPROGRAMS\Jorts\Preferences of Jorts.lnk" - Delete "$SMPROGRAMS\Startup\Jorts.lnk" + Delete "$SMPROGRAMS\@APP_NAME@\@APP_NAME@.lnk" + Delete "$SMPROGRAMS\@APP_NAME@\Preferences of @APP_NAME@.lnk" + Delete "$SMPROGRAMS\Startup\@APP_NAME@.lnk" ; Remove uninstaller Delete "$INSTDIR\Uninstall.exe" @@ -144,7 +144,7 @@ Section "Uninstall" !insertmacro RemoveFilesAndSubDirs "$INSTDIR" ; Remove directories used - RMDir $SMPROGRAMS\Jorts + RMDir $SMPROGRAMS\@APP_NAME@ RMDir "$INSTDIR" ; Remove font @@ -154,8 +154,8 @@ Section "Uninstall" DeleteRegKey HKCU "Software\Microsoft\Windows NT\CurrentVersion\Fonts\Inter Variable (TrueType)" ; Remove registry keys - DeleteRegKey HKCU "Software\Jorts" - DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" + DeleteRegKey HKCU "Software\@APP_ID@" + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\@APP_ID@" SectionEnd diff --git a/windows/meson.build b/windows/meson.build new file mode 100644 index 00000000..ca99e372 --- /dev/null +++ b/windows/meson.build @@ -0,0 +1,21 @@ +# +# WINDOWS +# + +#======================== +# DEPLOY + +config_deploy_script = configure_file( + input: 'deploy.sh.in', + output: 'deploy.sh', + configuration: config_data +) + +#======================== +# NSIS Installer script + +config_installer_script = configure_file( + input: 'installer.nsi.in', + output: app_name + '-installer.nsi', + configuration: config_data +) \ No newline at end of file