Skip to content

Commit b7392dc

Browse files
committed
adding pack for windows using NSIS
1 parent 73bdbe6 commit b7392dc

File tree

6 files changed

+242
-1
lines changed

6 files changed

+242
-1
lines changed

Assajjaa/Assajjaa.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CONFIG += help
1010
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
1111
TARGET = Assajjaa
1212
TEMPLATE = app
13-
VERSION = 0.0.2 #dev version
13+
VERSION = 0.1.0 #test version
1414

1515
DEFINES += VERSION=\\\"$$VERSION\\\"
1616
DEFINES += arbDbPath=\\\"./DB/arwords.db\\\" #/usr/share/assajjaa/DB

pack/windows/Assajjaa.nsi

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
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$\nClick `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

pack/windows/license/ar.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
حقوق النشر 2016 عبد الكريم عريس وهشام عمر
2+
3+
4+
مرخص تحت GNU GPLv3 أو أي نسخة لاحقة.
5+
6+
7+
هذا البرنامج هو برنامج حر: يمكنك إعادة توزيعه و/أو تعديله
8+
تحت شروط رخصة غنو العمومية والتي نشرتها مؤسسة البرمجيات الحرة،
9+
سواء الإصدار 3 من الرخصة، أو أي إصدار لاحق.
10+
11+
يوزع هذا البرنامج على أمل أن يكون مفيدا،
12+
ولكن من دون اي ضمانات؛ حتى دون ضمان
13+
صلاحية التسويق أو الملاءمة لغرض معين.
14+
راجع رخصة غنو العمومية لمزيد من التفاصيل.
15+
16+
17+
يجب أن تكون قد تلقيت نسخة من رخصة غنو العمومية مع هذا البرنامج.
18+
إن لم يكن كذلك، راجع http://www.gnu.org/licenses/

pack/windows/license/en.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright 2016 Abdelkrime Aries and Hisham Omar
2+
3+
4+
Licensed under GNU GPLv3 or later
5+
6+
7+
This program is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
any later version.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
18+
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/

pack/windows/license/fr.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Droits d'auteur 2016 Abdelkrime Aries et Hisham Omar
2+
3+
4+
Sous la licence GNU GPLv3 ou versions ultérieures.
5+
6+
7+
Ce programme est un logiciel libre: vous pouvez le redistribuer et/ou
8+
le modifier selon les termes de la Licence Publique Générale GNU, telle
9+
que publiée par la Free Software Foundation, soit la version 3 de la
10+
Licence, ou toute version ultérieure.
11+
12+
Ce programme est distribué dans l'espoir qu'il sera utile,
13+
mais SANS AUCUNE GARANTIE, sans même la garantie implicite de
14+
COMMERCIALISATION ou D'ADAPTATION À UN USAGE PARTICULIER.
15+
Voir la Licence Publique Générale GNU pour plus de détails.
16+
17+
18+
Vous devriez avoir reçu une copie de la Licence Publique Générale GNU avec ce programme. Sinon, voir http://www.gnu.org/licenses/

pack/windows/license/ja.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2013 Abdelkrime Aries and Hisham Omar
2+
3+
4+
GNU GPLv3 の下で、または後のバージョンの下でライセンスされています。
5+
6+
7+
このプログラムはフリーソフトウェアです。あなたはこれを、
8+
フリーソフトウェア財団によって発行されたGNU 一般公衆利用許諾書
9+
(バージョン3か、 それ以降のバージョンのうちどれか)
10+
が定める条件の下で再頒布または改変することができます。
11+
12+
このプログラムは有用であることを願って頒布されますが、
13+
*全くの無保証 *です。商業可能性の保証や特定目的への適合性は、
14+
言外に示されたものも 含め、全く存在しません。
15+
詳しくはGNU 一般公衆利用許諾書をご覧ください。
16+
17+
18+
あなたはこのプログラムと共に、GNU 一般公衆利用許諾書のコピーを一部受け取っているはずです。もし受け取っていなければ、http://www.gnu.org/licenses/ をご覧ください。
19+
20+

0 commit comments

Comments
 (0)