-
Notifications
You must be signed in to change notification settings - Fork 3
/
installer.nsi
171 lines (138 loc) · 5.44 KB
/
installer.nsi
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
!include MUI2.nsh
Name "Gmail Backup"
OutFile "inst_EXE\gmail-backup-installer.exe"
AllowRootDirInstall true
XPStyle on
; RequestExecutionLevel user
RequestExecutionLevel admin
SetCompressor /SOLID lzma
; The default installation directory
InstallDir "$PROGRAMFILES\GmailBackup"
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\GmailBackup" "Install_Dir"
!define MUI_COMPONENTSPAGE_NODESC
Var StartMenuFolder
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU "Application" $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Catalan"
;--------------------------------
;Installer Functions
Section "Gmail Backup (required)"
SectionIn RO
SetOutPath "$INSTDIR"
File "dist_EXE\*"
SetOutPath "$INSTDIR\messages"
File "dist_EXE\messages\*"
SetOutPath "$INSTDIR\messages\cs_CZ\LC_MESSAGES"
File "dist_EXE\messages\cs_CZ\LC_MESSAGES\*"
SetOutPath "$INSTDIR\messages\ru_RU\LC_MESSAGES"
File "dist_EXE\messages\ru_RU\LC_MESSAGES\*"
SetOutPath "$INSTDIR\messages\nl\LC_MESSAGES"
File "dist_EXE\messages\nl\LC_MESSAGES\*"
SetOutPath "$INSTDIR\messages\da\LC_MESSAGES"
File "dist_EXE\messages\da\LC_MESSAGES\*"
; Write the installation path into the registry
WriteRegStr HKLM "Software\GmailBackup" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gmailbackup" "DisplayName" "Gmail Backup"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gmailbackup" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gmailbackup" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gmailbackup" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
;Function .onInit
; !insertmacro MUI_LANGDLL_DISPLAY
;FunctionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\Gmail Backup"
CreateShortCut "$SMPROGRAMS\Gmail Backup\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe"
CreateShortCut "$SMPROGRAMS\Gmail Backup\GMail Backup.lnk" "$INSTDIR\gmail-backup-gui.exe" "" "$INSTDIR\gmb.ico"
CreateShortCut "$DESKTOP\GMail Backup.lnk" "$INSTDIR\gmail-backup-gui.exe" "" "$INSTDIR\gmb.ico"
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
SetShellVarContext all
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gmailbackup"
DeleteRegKey HKLM SOFTWARE\gmailbackup
; Remove files and uninstaller
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\Gmail Backup\*.*"
Delete "$DESKTOP\GMail Backup.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\Gmail Backup"
RMDir /r "$INSTDIR"
SectionEnd
;--------------------------------
;Uninstaller Functions
;Function un.onInit
; !insertmacro MUI_UNGETLANGUAGE
;FunctionEnd