~z-man/armagetronad/zeroinstall_tools

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
; Armagetron Advanced Client Setup Script
!define PRODUCT_BASENAME "Armagetron Zeroinstall Tools"
!define PRODUCT_NAME "${PRODUCT_BASENAME}"
!define PRODUCT_VERSION "0.1"
!define PRODUCT_PUBLISHER "Armagetron Advanced Team"
!define PRODUCT_WEB_SITE "http://armagetronad.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_BASENAME}\armagetronad.exe"
!define PRODUCT_BASE_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Armagetron Advanced\armagetronad.exe"

SetCompressor lzma

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
;!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
;!define MUI_WELCOMEFINISHPAGE_BITMAP "banner.bmp"

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES

; Welcome page
;!insertmacro MUI_PAGE_WELCOME
; License page
;!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Directory page
;!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
;!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!insertmacro MUI_PAGE_FINISH

; Language files
;!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
;!insertmacro MUI_LANGUAGE "French"
;!insertmacro MUI_LANGUAGE "German"
;!insertmacro MUI_LANGUAGE "Polish"
;!insertmacro MUI_LANGUAGE "Spanish"

; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
RequestExecutionLevel user
OutFile "armagetronad-zeroinstall-${PRODUCT_VERSION}.win32.exe"
; InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
; InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show

Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

!macro SetLinks DESC URI EXTRA
  CreateShortCut "${TARGET}\Armagetronad${DESC}.lnk" "0launch"\
                 "${EXTRA}${BASEURI}${URI}.xml"\
	         "${ICON}" 1 SW_SHOWMINIMIZED
  CreateShortCut "${TARGET}\Setup\Armagetronad ${DESC} Choose Version.lnk" "0launch" \
                  "--gui ${BASEURI}${URI}.xml" \
                  "${ICON}" 1 SW_SHOWNORMAL
  CreateShortCut "$DESKTOP\Zero Armagetronad ${DESC}.lnk" "0launch" \
                 "${EXTRA}${BASEURI}${URI}.xml" \
                 "${ICON}" 1 SW_SHOWMINIMIZED
!macroend

Section "MainSection" SEC01

  ReadRegStr $0 HKLM "${PRODUCT_BASE_DIR_REGKEY}" ""
  !define ICON $0

  SetOverwrite try

  SetShellVarContext current
  !define  TARGET "$SMPROGRAMS\${PRODUCT_BASENAME}"
  !define  BASEURI http://simamo.de/0install/armagetronad
  CreateDirectory "${TARGET}"
  CreateDirectory "${TARGET}\Setup"

  !insertmacro SetLinks "" "" ""
  !insertmacro SetLinks " Stable" "-stable" ""
  !insertmacro SetLinks " Beta" "-beta" ""
  !insertmacro SetLinks " Alpha" "-alpha" "-r "
  !insertmacro SetLinks "Experimental" "-experimental" "-r "

  SetShellVarContext current
SectionEnd