parent
87eb132af1
commit
dc727cb620
4 changed files with 42 additions and 11 deletions
|
@ -1,5 +1,6 @@
|
||||||
version: 2.6.0-branch-{branch}-build-{build}
|
version: 2.6.0-branch-{branch}-build-{build}
|
||||||
|
|
||||||
|
#BUILD!!!
|
||||||
# Skipping commits affecting specific files (GitHub only).
|
# Skipping commits affecting specific files (GitHub only).
|
||||||
# More details here: https://www.appveyor.com/docs/appveyor-yml and https://www.appveyor.com/docs/how-to/filtering-commits
|
# More details here: https://www.appveyor.com/docs/appveyor-yml and https://www.appveyor.com/docs/how-to/filtering-commits
|
||||||
skip_commits:
|
skip_commits:
|
||||||
|
|
|
@ -210,6 +210,11 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
|
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
|
||||||
|
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
||||||
|
set(TRICE_IS_64_BIT 1)
|
||||||
|
else()
|
||||||
|
set(TRICE_IS_64_BIT 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Configure file with custom definitions for NSIS.
|
# Configure file with custom definitions for NSIS.
|
||||||
configure_file(
|
configure_file(
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
!define NSIS_SOURCE_PATH "@PROJECT_SOURCE_DIR@"
|
!define NSIS_SOURCE_PATH "@PROJECT_SOURCE_DIR@"
|
||||||
|
!define NSIS_IS_64_BIT @TRICE_IS_64_BIT@
|
|
@ -3,9 +3,6 @@ Name "@CPACK_PACKAGE_NAME@"
|
||||||
BrandingText "@CPACK_PACKAGE_FILE_NAME@"
|
BrandingText "@CPACK_PACKAGE_FILE_NAME@"
|
||||||
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
|
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
|
||||||
|
|
||||||
!define UNINSTKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
|
|
||||||
!define DEFAULTNORMALDESTINATON "$ProgramFiles\Cockatrice"
|
|
||||||
!define DEFAULTPORTABLEDESTINATON "$Desktop\CockatricePortable"
|
|
||||||
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
|
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
|
||||||
|
|
||||||
RequestExecutionlevel highest
|
RequestExecutionlevel highest
|
||||||
|
@ -18,6 +15,7 @@ Var PortableMode
|
||||||
!include LogicLib.nsh
|
!include LogicLib.nsh
|
||||||
!include FileFunc.nsh
|
!include FileFunc.nsh
|
||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
!include x64.nsh
|
||||||
|
|
||||||
!define MUI_ABORTWARNING
|
!define MUI_ABORTWARNING
|
||||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIS_SOURCE_PATH}\cmake\leftimage.bmp"
|
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIS_SOURCE_PATH}\cmake\leftimage.bmp"
|
||||||
|
@ -46,8 +44,19 @@ Page Custom PortableModePageCreate PortableModePageLeave
|
||||||
!insertmacro MUI_LANGUAGE English
|
!insertmacro MUI_LANGUAGE English
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
StrCpy $NormalDestDir "${DEFAULTNORMALDESTINATON}"
|
|
||||||
StrCpy $PortableDestDir "${DEFAULTPORTABLEDESTINATON}"
|
${If} ${NSIS_IS_64_BIT} == 1
|
||||||
|
${IfNot} ${RunningX64}
|
||||||
|
MessageBox MB_OK|MB_ICONEXCLAMATION "This version of Cockatrice requires a 64-bit Windows system."
|
||||||
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
StrCpy $NormalDestDir "$ProgramFiles64\Cockatrice"
|
||||||
|
SetRegView 64
|
||||||
|
${Else}
|
||||||
|
StrCpy $NormalDestDir "$ProgramFiles\Cockatrice"
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
StrCpy $PortableDestDir "$Desktop\CockatricePortable"
|
||||||
|
|
||||||
${GetParameters} $9
|
${GetParameters} $9
|
||||||
|
|
||||||
|
@ -83,6 +92,13 @@ Call SetModeDestinationFromInstdir
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
Function un.onInit
|
||||||
|
|
||||||
|
${If} ${NSIS_IS_64_BIT} == 1
|
||||||
|
SetRegView 64
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Function RequireAdmin
|
Function RequireAdmin
|
||||||
UserInfo::GetAccountType
|
UserInfo::GetAccountType
|
||||||
|
@ -190,21 +206,29 @@ ${If} $PortableMode = 0
|
||||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||||
IntFmt $0 "0x%08X" $0
|
IntFmt $0 "0x%08X" $0
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "InstallLocation" "$INSTDIR"
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayVersion" "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
|
||||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "EstimatedSize" "$0"
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "EstimatedSize" "$0"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "InstallLocation" "$INSTDIR"
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoModify" "1"
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoRepair" "1"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "Publisher" "Cockatrice team"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@"
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@"
|
||||||
|
|
||||||
IfFileExists "$INSTDIR\vc_redist.x86.exe" VcRedist86Exists PastVcRedist86Check
|
IfFileExists "$INSTDIR\vc_redist.x86.exe" VcRedist86Exists PastVcRedist86Check
|
||||||
VcRedist86Exists:
|
VcRedist86Exists:
|
||||||
ExecWait '"$INSTDIR\vc_redist.x86.exe" /passive /norestart'
|
ExecWait '"$INSTDIR\vc_redist.x86.exe" /passive /norestart'
|
||||||
|
Delete "$INSTDIR\vc_redist.x86.exe"
|
||||||
PastVcRedist86Check:
|
PastVcRedist86Check:
|
||||||
|
|
||||||
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
|
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
|
||||||
VcRedist64Exists:
|
VcRedist64Exists:
|
||||||
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
|
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
|
||||||
|
Delete "$INSTDIR\vc_redist.x64.exe"
|
||||||
PastVcRedist64Check:
|
PastVcRedist64Check:
|
||||||
|
|
||||||
${Else}
|
${Else}
|
||||||
|
|
Loading…
Reference in a new issue