From a56926a23e07066525c76a7d16608fb544d02b19 Mon Sep 17 00:00:00 2001 From: Arindam Chaudhuri Date: Sun, 22 May 2022 11:31:42 +0530 Subject: [PATCH] nsis : skip choosing directory when updating or reinstalling --- src/common.h | 2 +- windows/PhotoQuick.nsi | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) mode change 100644 => 100755 windows/PhotoQuick.nsi diff --git a/src/common.h b/src/common.h index 67ac5ed..d81396f 100644 --- a/src/common.h +++ b/src/common.h @@ -4,7 +4,7 @@ #include #define PROG_NAME "PhotoQuick" -#define PROG_VERSION "4.12.0" +#define PROG_VERSION "4.12.1" #define COPYRIGHT_YEAR "2017-2021" #define AUTHOR_NAME "Arindam Chaudhuri" #define AUTHOR_EMAIL "ksharindam@gmail.com" diff --git a/windows/PhotoQuick.nsi b/windows/PhotoQuick.nsi old mode 100644 new mode 100755 index 7494291..88ae3c8 --- a/windows/PhotoQuick.nsi +++ b/windows/PhotoQuick.nsi @@ -1,6 +1,6 @@ ; HM NIS Edit Wizard helper defines !define PROG_NAME "PhotoQuick" -!define PROG_VERSION "4.12.0" +!define PROG_VERSION "4.12.1" !define PROG_PUBLISHER "Arindamsoft" !define PROG_ICON "photoquick.ico" !define PROG_EXEC "photoquick.exe" @@ -31,11 +31,20 @@ SetCompressor lzma ; MUI pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt" +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipDirectoryPage !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_RUN "$INSTDIR\${PROG_EXEC}" !insertmacro MUI_PAGE_FINISH +; Skip choosing directory when updating older version +Function SkipDirectoryPage + ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "" + ${IF} $0 != "" + Abort + ${EndIf} +FunctionEnd + ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files