From ea0f55bc6c92402ecbbc2af14c3e1074988cb413 Mon Sep 17 00:00:00 2001
From: kali <kali@win>
Date: Fri, 6 Nov 2020 00:36:30 +0100
Subject: [PATCH] [pkg] customize windows installer

I kind of liked the "classic" style more (looks cleaner), but it looks
like we only can customize the logo etc with the "modern" look and feel
in windows.

I think the way to go would be to add a QStyleSheet to the installer
(and adding logo etc there), but I think that is going to take some
reading. this is not too bad for now, at least we can put logos to
differentiate riseup/calyx etc.
---
 Makefile                                         | 3 +++
 branding/scripts/gen-qtinstaller                 | 4 ++++
 branding/templates/qtinstaller/config/config.xml | 2 ++
 branding/templates/qtinstaller/installer.pro     | 2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index eff630b6..a5639d81 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,9 @@ installer: check_qtifw checksign
 	@cp -r ${TEMPLATES}/qtinstaller/packages ${INSTALLER}
 	@cp -r ${TEMPLATES}/qtinstaller/installer.pro ${INSTALLER}
 	@cp -r ${TEMPLATES}/qtinstaller/config ${INSTALLER}
+	@cp ${VENDOR_PATH}/assets/icon.ico ${INSTALLER}/config/installer-icon.ico
+	@cp ${VENDOR_PATH}/assets/icon.icns ${INSTALLER}/config/installer-icon.icns
+	@cp ${VENDOR_PATH}/assets/installer-logo.png ${INSTALLER}/config/installer-logo.png
 ifeq (${PLATFORM}, darwin)
 	@mkdir -p ${INST_DATA}/helper
 	@VERSION=${VERSION} VENDOR_PATH=${VENDOR_PATH} ${SCRIPTS}/gen-qtinstaller osx ${INSTALLER}
diff --git a/branding/scripts/gen-qtinstaller b/branding/scripts/gen-qtinstaller
index 1f2c03d9..04ecaf7b 100755
--- a/branding/scripts/gen-qtinstaller
+++ b/branding/scripts/gen-qtinstaller
@@ -21,16 +21,20 @@ OS_CONFIG = {
       <RunProgramArguments>
         <Argument>@TargetDir@</Argument>
       </RunProgramArguments>
+
     <WizardStyle>mac</WizardStyle>
     <!-- end osx -->
 """,
     'windows': """
+    <!-- windows -->
     <TargetDir>@ApplicationsDir@/$APPNAME</TargetDir>
     <StartMenuDir>$APPNAME</StartMenuDir>
 
     <RunProgram>@TargetDir@/$BINNAME.exe</RunProgram>
     <RunProgramArguments>
     </RunProgramArguments>
+
+    <WizardStyle>Modern</WizardStyle>
     <!-- end windows -->
 """
 }
diff --git a/branding/templates/qtinstaller/config/config.xml b/branding/templates/qtinstaller/config/config.xml
index 13dba490..df7b6d4d 100644
--- a/branding/templates/qtinstaller/config/config.xml
+++ b/branding/templates/qtinstaller/config/config.xml
@@ -5,6 +5,8 @@
     <Title>$APPNAME Installer ($VERSION)</Title>
     <Publisher>LEAP Encryption Access Project</Publisher>
     <AllowNonAsciiCharacters>false</AllowNonAsciiCharacters>
+    <Logo>installer-logo.png</Logo>
+    <InstallerApplicationIcon>installer-icon</InstallerApplicationIcon>
 
     <!--
     <RemoteRepositories>
diff --git a/branding/templates/qtinstaller/installer.pro b/branding/templates/qtinstaller/installer.pro
index ec800c19..3d653344 100644
--- a/branding/templates/qtinstaller/installer.pro
+++ b/branding/templates/qtinstaller/installer.pro
@@ -5,7 +5,7 @@ CONFIG -= debug_and_release
 INPUT = $$PWD/config/config.xml $$PWD/packages
 inst.input = INPUT
 inst.output = $$INSTALLER
-inst.commands = binarycreator -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}
+inst.commands = binarycreator --ignore-translations -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}
 inst.CONFIG += target_predeps no_link combine
 
 QMAKE_EXTRA_COMPILERS += inst
-- 
GitLab