From 071cc856da12437fbb555e7a565669297007c54d Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 5 May 2020 21:47:26 -0400 Subject: [PATCH] Improve MSI Installer * Include checkboxes to install a desktop shortcut (default no) and start on login (default yes) * Fix closing KeePassXC.exe and keepassxc-proxy.exe before installation starts * Improve styling of launch after exit checkbox --- share/windows/KPXC_ExitDlg.wxs | 31 +++++++++++ share/windows/KPXC_InstallDir.wxs | 81 ++++++++++++++++++++++++++++ share/windows/KPXC_InstallDirDlg.wxs | 30 +++++++++++ share/windows/wix-template.xml | 76 ++++++++++++++++---------- src/CMakeLists.txt | 7 ++- 5 files changed, 195 insertions(+), 30 deletions(-) create mode 100644 share/windows/KPXC_ExitDlg.wxs create mode 100644 share/windows/KPXC_InstallDir.wxs create mode 100644 share/windows/KPXC_InstallDirDlg.wxs diff --git a/share/windows/KPXC_ExitDlg.wxs b/share/windows/KPXC_ExitDlg.wxs new file mode 100644 index 00000000..0ed4d3e8 --- /dev/null +++ b/share/windows/KPXC_ExitDlg.wxs @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/share/windows/KPXC_InstallDir.wxs b/share/windows/KPXC_InstallDir.wxs new file mode 100644 index 00000000..e56b95a2 --- /dev/null +++ b/share/windows/KPXC_InstallDir.wxs @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + "1"]]> + + 1 + + NOT Installed + Installed AND PATCH + + 1 + LicenseAccepted = "1" + + 1 + 1 + NOT WIXUI_DONTVALIDATEPATH + "1"]]> + WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" + 1 + 1 + + NOT Installed + Installed AND NOT PATCH + Installed AND PATCH + + 1 + + 1 + 1 + 1 + + + + + + + diff --git a/share/windows/KPXC_InstallDirDlg.wxs b/share/windows/KPXC_InstallDirDlg.wxs new file mode 100644 index 00000000..bc4ed9df --- /dev/null +++ b/share/windows/KPXC_InstallDirDlg.wxs @@ -0,0 +1,30 @@ + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/share/windows/wix-template.xml b/share/windows/wix-template.xml index 3f808723..228bf2a4 100644 --- a/share/windows/wix-template.xml +++ b/share/windows/wix-template.xml @@ -37,57 +37,75 @@ - - - - - WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed + LAUNCHAPPONEXIT + + + + AUTOSTARTPROGRAM + + + - + + + + + + + + + + + + + INSTALLDESKTOPSHORTCUT + + + - - - - - - - + + + + + + + + - - - - + - - + - - - Installed - Installed + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 02f313fc..e57973ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -461,9 +461,14 @@ if(MINGW) set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico") set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/share/windows/wix-banner.bmp") set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/share/windows/wix-dialog.bmp") + set(CPACK_WIX_UI_REF "KPXC_InstallDir") set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/share/windows/wix-template.xml") set(CPACK_WIX_PATCH_FILE "${CMAKE_SOURCE_DIR}/share/windows/wix-patch.xml") - set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org") + set(CPACK_WIX_EXTRA_SOURCES + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDir.wxs" + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDirDlg.wxs" + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_ExitDlg.wxs") + set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org") set(CPACK_WIX_EXTENSIONS "WixUtilExtension.dll") include(CPack)