3
; Application's version
7
!define APP_NAME "ITmages upload client"
9
; Default icon for the installer
10
!define MUI_ICON "D:\itmages.ico"
12
; Enables exit warning dialog
13
!define MUI_ABORTWARNING
15
; Setting application's name
18
; Name of the installation file
19
OutFile "itmages-extension-${VERSION}-win32.exe"
21
; Default installation directory
22
InstallDir "$PROGRAMFILES\ITmages"
30
;Request application privileges for Windows Vista and Windows 7
31
RequestExecutionLevel user
34
!insertmacro MUI_PAGE_WELCOME
35
!insertmacro MUI_PAGE_LICENSE "D:\ITmages\docs\COPYING.txt"
36
!insertmacro MUI_PAGE_DIRECTORY
38
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
39
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\ITmages"
40
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
42
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
43
!insertmacro MUI_PAGE_INSTFILES
46
!insertmacro MUI_UNPAGE_WELCOME
47
!insertmacro MUI_UNPAGE_CONFIRM
48
!insertmacro MUI_UNPAGE_INSTFILES
51
!insertmacro MUI_LANGUAGE "Russian"
52
!insertmacro MUI_LANGUAGE "English"
54
; Associates ITmages client with the selected file extension
55
Function AssociateWithExtension
59
${if} $LANGUAGE = 1049
60
WriteRegStr HKCR "SystemFileAssociations\$0\Shell\itmagesupload" "" "��������� �� ITmages"
61
${elseif} $LANGUAGE = 1033
62
WriteRegStr HKCR "SystemFileAssociations\$0\Shell\itmagesupload" "" "Upload to ITmages"
65
WriteRegStr HKCR "SystemFileAssociations\$0\Shell\itmagesupload" "Icon" "$INSTDIR\itmages.exe,0"
66
WriteRegStr HKCR "SystemFileAssociations\$0\Shell\itmagesupload\Command" "" "$INSTDIR\itmages.exe %1"
72
; Checks if the application was already installed
75
ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "UninstallString"
77
StrCmp $R0 "" NotInstalled +1
78
${if} $LANGUAGE = 1049
79
messagebox::show MB_DEFBUTTON4|MB_TOPMOST "ITmages upload client" \
81
"ITmages upload client ��� ����������." \
83
${elseif} $LANGUAGE = 1033
84
messagebox::show MB_DEFBUTTON4|MB_TOPMOST "ITmages upload client" \
86
"ITmages upload client is already installed." \
99
; Installer language selection function
100
Function InstallLanguage
108
LangDLL::LangDialog "Choose the language" "Select the language of the installer"
110
StrCmp $LANGUAGE "cancel" 0 +2
115
;Uninstaller language selection function
116
Function un.UninstallLanguage
124
LangDLL::LangDialog "Choose the language" "Select the language of the uninstaller"
126
StrCmp $LANGUAGE "cancel" 0 +2
131
Section "ITmages" SecMain
134
SetOutPath "$INSTDIR"
137
SetOutPath "$INSTDIR\docs"
138
File "D:\ITmages\docs\"
140
SetOutPath "$INSTDIR\locale\ru\LC_MESSAGES"
141
File "D:\ITmages\locale\ru\LC_MESSAGES\"
143
; Creating uninstaller
144
WriteUninstaller "$INSTDIR\uninstall.exe"
146
; Putting information about the application to the registry
147
WriteRegStr HKCU "Software\ITmages" "" $INSTDIR
149
; Creating startmenu entry
150
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
152
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
153
${if} $LANGUAGE = 1049
154
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\ITmages - ������ ��� �������� �����������.lnk" "$INSTDIR\itmages.exe"
155
${elseif} $LANGUAGE = 1033
156
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\ITmages Upload Client.lnk" "$INSTDIR\itmages.exe"
158
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
160
!insertmacro MUI_STARTMENU_WRITE_END
162
; Creating desktop shourtcut
163
${if} $LANGUAGE = 1049
164
CreateShortCut "$DESKTOP\ITmages - ������ ��� �������� �����������.lnk" "$INSTDIR\itmages.exe"
165
${elseif} $LANGUAGE = 1033
166
CreateShortCut "$DESKTOP\ITmages Upload Client.lnk" "$INSTDIR\itmages.exe"
169
; Registry strings to add uninstall information to Add/Remove programs
170
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "DisplayName" "ITmages upload client"
171
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
172
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "DisplayIcon" "$\"$INSTDIR\itmages.exe$\""
173
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "Publisher" "ITmages"
174
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages" "DisplayVersion" "${VERSION}"
176
; Create association with png files
178
Call AssociateWithExtension
180
; Create association with jpeg files
182
Call AssociateWithExtension
184
; Create association with jpg files
186
Call AssociateWithExtension
188
; Create association with gif files
190
Call AssociateWithExtension
201
; Removing application's directory
204
; Removing startmenu entry
205
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
206
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
208
; Removing desktop shortcat
209
Delete "$DESKTOP\ITmages*.lnk"
211
; Removing "Upload to ITmages" action from the context menu
212
DeleteRegKey HKCR "SystemFileAssociations\.png\Shell\itmagesupload"
213
DeleteRegKey HKCR "SystemFileAssociations\.jpeg\Shell\itmagesupload"
214
DeleteRegKey HKCR "SystemFileAssociations\.jpg\Shell\itmagesupload"
215
DeleteRegKey HKCR "SystemFileAssociations\.gif\Shell\itmagesupload"
217
; Removing the uninstall information from the registry
218
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ITmages"
220
; Removing information about the application from the registry
221
DeleteRegKey /ifempty HKCU "Software\ITmages"
227
Call un.UninstallLanguage