-
Notifications
You must be signed in to change notification settings - Fork 3
/
DNG4PS-2.nsi
132 lines (91 loc) · 3.56 KB
/
DNG4PS-2.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
!define PROG_NAME dng4ps2
!include "MUI.nsh"
!include "LogicLib.nsh"
SetCompressor /SOLID lzma
SetCompressorDictSize 32
LicenseBkColor /windows
XPStyle on
; The name of the installer
Name "${PROG_NAME}"
; The file to write
OutFile "setup\${PROG_NAME}-${PROG_VERS}.exe"
; The default installation directory
InstallDir $PROGRAMFILES\${PROG_NAME}
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\${PROG_NAME}" "Install_Dir"
!define MUI_ABORTWARNING
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
BrandingText 'DNG for PowerShot-2'
; Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE src\license.txt
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_RESERVEFILE_LANGDLL
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;--------------------------------
; The stuff to install
Section "${PROG_NAME}"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File /r "src\bin\win\Release\langs"
File "src\bin\win\Release\dng4ps-2.exe"
File "src\changes_en.txt"
File "src\changes_ru.txt"
File "src\license.txt"
File "src\readme_en.txt"
File "src\readme_rus.txt"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\${PROG_NAME} "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROG_NAME}" "DisplayName" "${PROG_NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROG_NAME}" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROG_NAME}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROG_NAME}" "NoRepair" 1
WriteUninstaller "uninstall.exe"
${Switch} $LANGUAGE
${Case} 1049 ; Russian
WriteRegDWORD HKCU "Software\${PROG_NAME}" "Language" 156
${Break}
${Case} 1034 ; Spanish
WriteRegDWORD HKCU "Software\${PROG_NAME}" "Language" 175
${Break}
${Case} 1031 ; German
WriteRegDWORD HKCU "Software\${PROG_NAME}" "Language" 87
${Break}
${Case} 1044 ; Norwegian.nlf
WriteRegDWORD HKCU "Software\${PROG_NAME}" "Language" 144
${Break}
${Default} ; English
WriteRegDWORD HKCU "Software\${PROG_NAME}" "Language" 56
${Break}
${EndSwitch}
CreateDirectory "$SMPROGRAMS\${PROG_NAME}"
CreateShortCut "$SMPROGRAMS\${PROG_NAME}\DNG for PowerShot-2.lnk" "$INSTDIR\DNG4PS-2.EXE" "" "$INSTDIR\DNG4PS-2.EXE" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROG_NAME}"
DeleteRegKey HKLM SOFTWARE\${PROG_NAME}
; Remove files and uninstaller
RMDir /r "$INSTDIR"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\${PROG_NAME}\*.*"
SectionEnd