diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ac5c2b22..52cf470d5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include(cmake/FreecivBuildOptions.cmake) # Set some project variables to reuse later set(FREECIV21_VERSION_MAJOR 3) set(FREECIV21_VERSION_MINOR 0) -set(FREECIV21_VERSION_PATCH 20210719) +set(FREECIV21_VERSION_PATCH 20210721) set(FREECIV21_VERSION "${FREECIV21_VERSION_MAJOR}.${FREECIV21_VERSION_MINOR}.${FREECIV21_VERSION_PATCH}") # Set project diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake index a6a53f19f9..dc11bd34c4 100644 --- a/cmake/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -66,14 +66,6 @@ if(WIN32 OR MSYS OR MINGW) set(CPACK_COMPONENT_TOOL_MANUAL_DISPLAY_NAME "Server Manual Tool") set(CPACK_COMPONENT_TRANSLATIONS_DISPLAY_NAME "Languages") - # Give the components a long description - set(CPACK_COMPONENT_FREECIV21_DESCRIPTION "All programs and supporting files to run Freeciv21. Includes Qt Client, Server and Qt Modpack Installer.") - set(CPACK_COMPONENT_TOOL_RULEDIT_DESCRIPTION "Freeciv21 Ruleset Editor") - set(CPACK_COMPONENT_TOOL_FCMP_CLI_DESCRIPTION "Modpack Installer Command Line Interpreter Edition") - set(CPACK_COMPONENT_TOOL_RULEUP_DESCRIPTION "Freeciv21 Ruleset Upgrade Tool") - set(CPACK_COMPONENT_TOOL_MANUAL_DESCRIPTION "Freeciv21 Server Manual Tool") - set(CPACK_COMPONENT_TRANSLATIONS_DESCRIPTION "Supported Languages") - ## Generator-specific configuration ## # NSIS (Windows .exe installer) @@ -90,7 +82,6 @@ if(WIN32 OR MSYS OR MINGW) set(CPACK_NSIS_COMPRESSOR "/SOLID lzma") # zlib|bzip2|lzma set(CPACK_NSIS_COMPRESSOR "${CPACK_NSIS_COMPRESSOR}\n SetCompressorDictSize 64") # hack (improve compression) set(CPACK_NSIS_COMPRESSOR "${CPACK_NSIS_COMPRESSOR}\n BrandingText '${CPACK_PACKAGE_DESCRIPTION_SUMMARY}'") # hack (overwrite BrandingText) - set(CPACK_NSIS_COMPRESSOR "${CPACK_NSIS_COMPRESSOR}\n !define MUI_COMPONENTSPAGE_SMALLDESC") # hack (better components page layout) endif() diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index a13a0d987a..1c9efe5365 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -6,28 +6,18 @@ ;######################################################### ; Freeciv21 Windows installer script -; some parts adapted from classic Freeciv and Wesnoth +; some parts adapted from classic Freeciv and Wesnoth ; installer scripts. ;######################################################### Unicode true SetCompressor @CPACK_NSIS_COMPRESSOR@ -;######################################################### -; Includes -;######################################################### - - !include "MUI2.nsh" - !include "LogicLib.nsh" - !include "Integration.nsh" - !include "Sections.nsh" - !include "Library.nsh" - !include "x64.nsh" - ;######################################################### ; Defines ;######################################################### + ;Generic Variables !define APPNAME "@CPACK_PACKAGE_NAME@" !define VERSION "@CPACK_PACKAGE_VERSION@" !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@" @@ -38,20 +28,38 @@ !define REGPATH_UNINSTSUBKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPID}" !define MUI_ICON "@CPACK_NSIS_MUI_ICON@" !define MUI_UNICON "@CPACK_NSIS_MUI_UNIICON@" + !define MUI_UI_COMPONENTSPAGE_SMALLDESC + !define MUI_LICENSEPAGE_CHECKBOX + !define MUI_LICENSEPAGE_CHECKBOX_TEXT "I agree to the license terms." + + ;Multi-User Variables + !define MULTIUSER_EXECUTIONLEVEL Highest + !define MULTIUSER_MUI + !define MULTIUSER_INSTALLMODE_COMMANDLINE + !define MULTIUSER_INSTALLMODEPAGE_TEXT_TOP "Select the type of installation you want to perform:" + !define MULTIUSER_INSTALLMODE_INSTDIR "${APPNAME}-${VERSION}" + +;######################################################### +; Includes +;######################################################### + + !include "MUI2.nsh" + !include "MultiUser.nsh" + !include "LogicLib.nsh" + !include "Integration.nsh" + !include "Sections.nsh" + !include "Library.nsh" + !include "x64.nsh" ;######################################################### ; General ;######################################################### Name "${APPNAME} v${VERSION}" - OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" + OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" ShowInstDetails show ShowUninstDetails show SetOverwrite on - RequestExecutionLevel Admin ; Request admin rights on WinVista+ (when UAC is turned on) - - ;Default installation folder - InstallDir "@CPACK_NSIS_INSTALL_ROOT@\${APPNAME}-${VERSION}" ;######################################################### ; Interface Settings @@ -76,37 +84,37 @@ ; However, we choose to manually define so that we can control ; the order of the list of components to install. ; By default, tools is put on top, which we don't want. - + Section "Freeciv21" freeciv21 SectionIn RO 1 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\freeciv21\*.*" SectionEnd SectionGroup "Tools" Tools Section "Ruleset Editor" tool_ruledit SectionIn 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\tool_ruledit\*.*" SectionEnd Section "Modpack Installer CLI Edition" tool_fcmp_cli SectionIn 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\tool_fcmp_cli\*.*" SectionEnd Section "Ruleset Upgrade Tool" tool_ruleup SectionIn 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\tool_ruleup\*.*" SectionEnd Section "Server Manual Tool" tool_manual SectionIn 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\tool_manual\*.*" SectionEnd SectionGroupEnd Section "Languages" translations SectionIn 1 2 - SetOutPath "$INSTDIR" + SetOutPath $INSTDIR File /r "${INST_DIR}\translations\*.*" SectionEnd @@ -127,8 +135,9 @@ ; Installer Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" - !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MULTIUSER_PAGE_INSTALLMODE + !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES ; TODO: add a run feature !insertmacro MUI_PAGE_FINISH @@ -149,13 +158,11 @@ ; Macros ;######################################################### - !macro EnsureAdminRights + !macro CheckAdminRights UserInfo::GetAccountType Pop $0 - ${If} $0 != "admin" ; Require admin rights on WinNT4+ - MessageBox MB_IconStop "Administrator rights required!" - SetErrorLevel 740 ; ERROR_ELEVATION_REQUIRED - Quit + ${If} $0 != "admin" ; Check for admin rights on WinNT4+ + MessageBox MB_IconInformation "Administrator rights not detected, installing in User's Home Directory by default." ${EndIf} !macroend @@ -165,19 +172,20 @@ Function .onInit SetShellVarContext All - !insertmacro EnsureAdminRights + !insertmacro MULTIUSER_INIT + ;!insertmacro CheckAdminRights FunctionEnd Function un.onInit SetShellVarContext All - !insertmacro EnsureAdminRights + !insertmacro MULTIUSER_UNINIT FunctionEnd Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString - WriteRegStr HKLM "${REGPATH_UNINSTSUBKEY}" "$1" "$0" + WriteRegStr "SHCTX" "${REGPATH_UNINSTSUBKEY}" "$1" "$0" ConditionalAddToRegisty_EmptyString: FunctionEnd @@ -188,23 +196,22 @@ Section "-Core installation" SetOutPath "$INSTDIR" - + ; Store installation folder. - WriteRegStr HKLM "Software\${APPID}" "Install Directory" $INSTDIR - + WriteRegStr "SHCTX" "SOFTWARE\${APPNAME}\${VERSION}\${CPU_ARCH}" "" "$INSTDIR" + ; Create uninstaller. WriteUninstaller "$INSTDIR\Uninstall.exe" - + + ; Create Desktop Icon - CreateShortCut "$DESKTOP\${APPNAME} Client.lnk" "$INSTDIR\freeciv21-client.exe" '"${Arg}"' "$INSTDIR\client.ico" 0 + CreateShortCut "$DESKTOP\${APPNAME} Client.lnk" "$INSTDIR\freeciv21-client.exe" "" "$INSTDIR\client.ico" 0 ; Create Start Menu Entries CreateDirectory "$SMPROGRAMS\${APPNAME} v${VERSION}" - CreateShortCut "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Client.lnk" "$INSTDIR\freeciv21-client.exe" '"${Arg}"' "$INSTDIR\client.ico" 0 - CreateShortCut "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Modpack Installer.lnk" "$INSTDIR\freeciv21-modpack-qt.exe" '"${Arg}"' "$INSTDIR\mp.ico" 0 - CreateShortCut "$SMPROGRAMS\${APPNAME} v${VERSION}\Uninstall ${APPNAME}.lnk" "$INSTDIR\Uninstall.exe" + CreateShortCut "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Client.lnk" "$INSTDIR\freeciv21-client.exe" "" "$INSTDIR\client.ico" 0 + CreateShortCut "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Modpack Installer.lnk" "$INSTDIR\freeciv21-modpack-qt.exe" "" "$INSTDIR\mp.ico" 0 - ; Create entry in Windows "Add/Remove programs" panel. Push "DisplayName" Push "${APPNAME} v${VERSION}" @@ -251,21 +258,19 @@ ; Remove uninstaller. Delete "$INSTDIR\Uninstall.exe" - + ; Remove shortcuts Delete "$DESKTOP\${APPNAME} Client.lnk" - Delete "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Client.lnk" - Delete "$SMPROGRAMS\${APPNAME} v${VERSION}\${APPNAME} Modpack Installer.lnk" - Delete "$SMPROGRAMS\${APPNAME} v${VERSION}\Uninstall ${APPNAME}.lnk" - RMDir "$SMPROGRAMS\${APPNAME} v${VERSION]" - + Delete "$SMPROGRAMS\${APPNAME} v${VERSION}\*.*" + RMDir "$SMPROGRAMS\${APPNAME} v${VERSION}" + ; Remove rest of installed files. ; Custom files are left intact. RMDir "$INSTDIR" ; Remove entry from Windows "Add/Remove programs" panel. - DeleteRegKey HKLM "${REGPATH_UNINSTSUBKEY}" - DeleteRegKey HKLM "Software\${APPID}" + DeleteRegKey "SHCTX" "${REGPATH_UNINSTSUBKEY}" + DeleteRegKey "SHCTX" "Software\${APPID}" SectionEnd diff --git a/fc_version b/fc_version index 5157d75d67..206d6b1279 100755 --- a/fc_version +++ b/fc_version @@ -7,8 +7,8 @@ MAJOR_VERSION="3" MINOR_VERSION="0" -PATCH_VERSION="20210719" -EMERGENCY_VERSION="2" +PATCH_VERSION="20210721" +EMERGENCY_VERSION="3" VERSION_LABEL="-alpha" # 1) Development until MAJOR and MINOR version numbers are diff --git a/utility/fc_version.h b/utility/fc_version.h index c6285cbb97..553f63adfc 100644 --- a/utility/fc_version.h +++ b/utility/fc_version.h @@ -2,13 +2,13 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 0 -#define PATCH_VERSION 20210719 -#define EMERGENCY_VERSION 2 +#define PATCH_VERSION 20210721 +#define EMERGENCY_VERSION 3 #ifndef VERSION_LABEL #define VERSION_LABEL "-alpha" #endif #ifndef VERSION_STRING -#define VERSION_STRING "3.0.20210719.2-alpha" +#define VERSION_STRING "3.0.20210721.3-alpha" #endif #define NETWORK_CAPSTRING "+Freeciv21.21April13"