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 file to write
13
+ OutFile " Assajjaa-0.1.0beta.exe"
14
+
15
+ ; The default installation directory
16
+ InstallDir " $PROGRAMFILES\Assajjaa"
17
+
18
+ ; Registry key to check for directory (so if you install again, it will
19
+ ; overwrite the old one automatically)
20
+ InstallDirRegKey HKLM " Software\Assajjaa" " Install_Dir"
21
+
22
+ ; Request application privileges for Windows Vista
23
+ RequestExecutionLevel admin
24
+
25
+ ; --------------------------------
26
+ Page license
27
+ Page components
28
+ Page directory
29
+ Page instfiles
30
+
31
+ UninstPage uninstConfirm
32
+ UninstPage instfiles
33
+ ; --------------------------------
34
+
35
+ ; First is default
36
+ LoadLanguageFile " ${NSISDIR}\Contrib\Language files\English.nlf"
37
+ LoadLanguageFile " ${NSISDIR}\Contrib\Language files\Arabic.nlf"
38
+ LoadLanguageFile " ${NSISDIR}\Contrib\Language files\Japanese.nlf"
39
+ LoadLanguageFile " ${NSISDIR}\Contrib\Language files\French.nlf"
40
+
41
+ ; License data
42
+ LicenseLangString myLicenseData ${LANG_ENGLISH} " Assajjaa\license\en.txt"
43
+ LicenseLangString myLicenseData ${LANG_ARABIC} " Assajjaa\license\ar.txt"
44
+ LicenseLangString myLicenseData ${LANG_JAPANESE} " Assajjaa\license\ja.txt"
45
+ LicenseLangString myLicenseData ${LANG_FRENCH} " Assajjaa\license\fr.txt"
46
+ LicenseData $(myLicenseData)
47
+
48
+ ; Set name using the normal interface (Name command)
49
+ LangString Name ${LANG_ENGLISH} " Assajjaa "
50
+ LangString Name ${LANG_ARABIC} " السجاع "
51
+ LangString Name ${LANG_JAPANESE} " アッサッジャア "
52
+ LangString Name ${LANG_FRENCH} " Assajjaa "
53
+ Name $(Name )
54
+
55
+ ; Section Assajjaa
56
+ Section " Assajjaa"
57
+ SectionIn RO
58
+
59
+ ; Set output path to the installation directory.
60
+ SetOutPath $INSTDIR
61
+
62
+ ; Put file there
63
+ File /r " Assajjaa\*"
64
+
65
+ ; Write the installation path into the registry
66
+ WriteRegStr HKLM SOFTWARE\Assajjaa " Install_Dir" " $INSTDIR"
67
+
68
+ ; Write the uninstall keys for Windows
69
+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" " DisplayName" " Assajjaa"
70
+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" " UninstallString" ' "$INSTDIR\uninstall.exe"'
71
+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" " NoModify" 1
72
+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" " NoRepair" 1
73
+ WriteUninstaller " uninstall.exe"
74
+
75
+ SectionEnd
76
+
77
+ ; Section Start Menu Shortcuts
78
+ LangString startM ${LANG_ENGLISH} " Start Menu Shortcuts"
79
+ LangString startM ${LANG_ARABIC} " اختصارات قائمة ابدأ"
80
+ LangString startM ${LANG_JAPANESE} " スタートメニューのショートカット"
81
+ LangString startM ${LANG_FRENCH} " Raccourcis du menu Démarrer"
82
+ Section !$(startM) sec1
83
+ CreateDirectory " $SMPROGRAMS\Assajjaa"
84
+ CreateShortCut " $SMPROGRAMS\Assajjaa\Uninstall.lnk" " $INSTDIR\uninstall.exe" " " " $INSTDIR\uninstall.exe" 0
85
+ CreateShortCut " $SMPROGRAMS\Assajjaa\Assajjaa.lnk" " $INSTDIR\jpconj.exe" " " " $INSTDIR\jpconj.exe" 0
86
+ SectionEnd
87
+
88
+ ; Section Desktop Shortcut
89
+ LangString desk ${LANG_ENGLISH} " Desktop Shortcut"
90
+ LangString desk ${LANG_ARABIC} " اختصار سطح المكتب"
91
+ LangString desk ${LANG_JAPANESE} " デスクトップのショートカット"
92
+ LangString desk ${LANG_FRENCH} " Raccourci du bureau"
93
+ Section !$(desk) sec2
94
+ CreateShortCut " $DESKTOP\Assajjaa.lnk" " $INSTDIR\Assajjaa.exe" " " " $INSTDIR\Assajjaa.exe" 0
95
+ SectionEnd
96
+
97
+ ; --------------------------------
98
+
99
+ Function .onInit
100
+
101
+ ReadRegStr $R0 HKLM \
102
+ " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa" \
103
+ " UninstallString"
104
+ StrCmp $R0 " " done
105
+
106
+ MessageBox MB_OKCANCEL |MB_ICONEXCLAMATION \
107
+ " Assajjaa is already installed. $\n$\n Click `OK` to remove the \
108
+ previous version or `Cancel` to cancel this upgrade." \
109
+ IDOK uninst
110
+ Abort
111
+
112
+ ; Run the uninstaller
113
+ uninst:
114
+ ClearErrors
115
+ ExecWait ' $R0 _?=$INSTDIR' ; Do not copy the uninstaller to a temp file
116
+
117
+ IfErrors no_remove_uninstaller done
118
+ ; You can either use Delete /REBOOTOK in the uninstaller or add some code
119
+ ; here to remove the uninstaller. Use a registry key to check
120
+ ; whether the user has chosen to uninstall. If you are using an uninstaller
121
+ ; components page, make sure all sections are uninstalled.
122
+ no_remove_uninstaller:
123
+ Abort
124
+ done:
125
+
126
+ ; Language selection dialog
127
+
128
+ Push " "
129
+ Push ${LANG_ENGLISH}
130
+ Push English
131
+ Push ${LANG_ARABIC}
132
+ Push Arabic
133
+ Push ${LANG_JAPANESE}
134
+ Push Japanese
135
+ Push ${LANG_FRENCH}
136
+ Push French
137
+ Push A ; A means auto count languages
138
+ ; for the auto count to work the first empty push (Push "") must remain
139
+ LangDLL::LangDialog " Installer Language" " Please select the language of the installer"
140
+
141
+ Pop $LANGUAGE
142
+ StrCmp $LANGUAGE " cancel" 0 +2
143
+ Abort
144
+ FunctionEnd
145
+
146
+ ; Uninstaller
147
+
148
+ Section " Uninstall"
149
+
150
+ ; Remove registry keys
151
+ DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Assajjaa"
152
+ DeleteRegKey HKLM SOFTWARE\Assajjaa
153
+
154
+ ; Remove files and uninstaller
155
+ ; Delete /r $INSTDIR\*
156
+ ; Delete $INSTDIR\uninstall.exe
157
+ RMDir /r " $INSTDIR"
158
+
159
+ ; Remove shortcuts, if any
160
+ Delete " $SMPROGRAMS\Assajjaa\*.*"
161
+ Delete " $DESKTOP\Assajjaa.lnk"
162
+
163
+ ; Remove directories used
164
+ RMDir " $SMPROGRAMS\Assajjaa"
165
+
166
+
167
+ SectionEnd
0 commit comments