Skip to content

Commit b96346d

Browse files
committed
add updater to windows pack
1 parent d3ccf81 commit b96346d

File tree

2 files changed

+107
-3
lines changed

2 files changed

+107
-3
lines changed

pack/windows/Assajjaa-updater.nsi

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
; Assajjaa.nsi
2+
3+
;--------------------------------
4+
5+
;Unicode true
6+
7+
XPStyle on
8+
9+
; The name of the installer
10+
;Name "Assajjaa"
11+
12+
; The version of Assajjaa
13+
!define Version 0.2.0
14+
15+
16+
; The file to write
17+
OutFile "Assajjaa-0.1.0to0.2.0update.exe"
18+
19+
; The default installation directory
20+
;InstallDir "$PROGRAMFILES\Assajjaa"
21+
22+
; Registry key to check for directory (so if you install again, it will
23+
; overwrite the old one automatically)
24+
;InstallDirRegKey HKLM "Software\Assajjaa" "Install_Dir"
25+
26+
27+
; Request application privileges for Windows Vista
28+
RequestExecutionLevel admin
29+
30+
;--------------------------------
31+
Page license
32+
Page components
33+
Page directory dirPre
34+
Page instfiles
35+
36+
UninstPage uninstConfirm
37+
UninstPage instfiles
38+
;--------------------------------
39+
40+
; First is default
41+
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
42+
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Arabic.nlf"
43+
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Japanese.nlf"
44+
LoadLanguageFile "${NSISDIR}\Contrib\Language files\French.nlf"
45+
46+
; License data
47+
LicenseLangString myLicenseData ${LANG_ENGLISH} "Assajjaa\license\en.txt"
48+
LicenseLangString myLicenseData ${LANG_ARABIC} "Assajjaa\license\ar.txt"
49+
LicenseLangString myLicenseData ${LANG_JAPANESE} "Assajjaa\license\ja.txt"
50+
LicenseLangString myLicenseData ${LANG_FRENCH} "Assajjaa\license\fr.txt"
51+
LicenseData $(myLicenseData)
52+
53+
; Set name using the normal interface (Name command)
54+
LangString Name ${LANG_ENGLISH} " Assajjaa "
55+
LangString Name ${LANG_ARABIC} " السجاع "
56+
LangString Name ${LANG_JAPANESE} " アッサッジャア "
57+
LangString Name ${LANG_FRENCH} " Assajjaa "
58+
Name $(Name)
59+
60+
; Section Assajjaa
61+
Section "Assajjaa"
62+
SectionIn RO
63+
64+
ReadRegStr $INSTDIR HKLM "SOFTWARE\Assajjaa" "Install_Dir"
65+
66+
; Set output path to the installation directory.
67+
SetOutPath $INSTDIR
68+
69+
; Put file there
70+
File /r "Assajjaa\Assajjaa.exe"
71+
72+
; Write the installation path into the registry
73+
;WriteRegStr HKLM SOFTWARE\Assajjaa "Install_Dir" "$INSTDIR"
74+
WriteRegStr HKLM SOFTWARE\Assajjaa "Version" "${Version}"
75+
76+
77+
SectionEnd
78+
79+
80+
;--------------------------------
81+
82+
Function .onInit
83+
Push ""
84+
Push ${LANG_ENGLISH}
85+
Push English
86+
Push ${LANG_ARABIC}
87+
Push Arabic
88+
Push ${LANG_JAPANESE}
89+
Push Japanese
90+
Push ${LANG_FRENCH}
91+
Push French
92+
Push A ; A means auto count languages
93+
; for the auto count to work the first empty push (Push "") must remain
94+
LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
95+
96+
Pop $LANGUAGE
97+
StrCmp $LANGUAGE "cancel" 0 +2
98+
Abort
99+
FunctionEnd
100+
101+
Function dirPre
102+
Abort
103+
FunctionEnd

pack/windows/Assajjaa.nsi

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ XPStyle on
88

99
; The name of the installer
1010
;Name "Assajjaa"
11+
!define Version 0.2.0
1112

1213
; The file to write
13-
OutFile "Assajjaa-0.1.0beta.exe"
14+
OutFile "Assajjaa-0.2.0beta.exe"
1415

1516
; The default installation directory
1617
InstallDir "$PROGRAMFILES\Assajjaa"
1718

1819
; Registry key to check for directory (so if you install again, it will
1920
; overwrite the old one automatically)
20-
InstallDirRegKey HKLM "Software\Assajjaa" "Install_Dir"
21+
;InstallDirRegKey HKLM "Software\Assajjaa" "Install_Dir"
2122

2223
; Request application privileges for Windows Vista
2324
RequestExecutionLevel admin
@@ -64,7 +65,7 @@ Section "Assajjaa"
6465

6566
; Write the installation path into the registry
6667
WriteRegStr HKLM SOFTWARE\Assajjaa "Install_Dir" "$INSTDIR"
67-
68+
WriteRegStr HKLM SOFTWARE\Assajjaa "Version" "${Version}"
6869
; Write the uninstall keys for Windows
6970
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" "DisplayName" "Assajjaa"
7071
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" "UninstallString" '"$INSTDIR\uninstall.exe"'

0 commit comments

Comments
 (0)