Various changes to preferences object, file loading, and error logging.
[jben.git] / installer.nsi
blobcb0c7b1a09495c1ac581b08476ac176fbc718c22
1 Name "J-Ben ${VERSION} Installer"
2 OutFile "J-Ben_${VERSION}_Installer.exe"
3 InstallDir $PROGRAMFILES\J-Ben
4 InstallDirRegKey HKLM \
5 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
6 "InstallLocation"
8 LicenseData J-Ben\license\gpl-2.0.txt
9 LicenseForceSelection checkbox
11 Page license
12 Page components
13 Page directory
14 Page instfiles
15 UninstPage uninstConfirm
16 UninstPage components
17 UninstPage instfiles
19 # I am deliberately being very specific on which files are installed
20 # and uninstalled. This allows us to easily copy/paste from the
21 # installer section to the uninstaller, ensuring we ONLY remove the files
22 # we installed. It's ugly, I know, but the script suggested to automate
23 # this is ugly enough by itself.
24 Section "!J-Ben Core"
25 # Program Files\J-Ben
26 SetOutPath "$INSTDIR"
27 File "J-Ben\jben.exe"
28 File "J-Ben\jben_kpengine.exe"
29 File "J-Ben\libcharset1.dll"
30 File "J-Ben\libiconv2.dll"
31 File "J-Ben\libstlport.5.1.dll"
32 File "J-Ben\mingwm10.dll"
33 File "J-Ben\wxbase28u_gcc_vultaire.net.dll"
34 File "J-Ben\wxmsw28u_core_gcc_vultaire.net.dll"
35 File "J-Ben\wxmsw28u_html_gcc_vultaire.net.dll"
36 File "J-Ben\README.txt"
37 File "J-Ben\CHANGELOG.txt"
38 # The following 2 folders will always be added/removed in full,
39 # so using File /r (and RMDir /r on uninstall) is acceptable.
40 File /r "J-Ben\kpengine_data"
41 File /r "J-Ben\license"
43 # Program Files\J-Ben\dicts
44 # By default, we install EDICT2, KANJIDIC, KRADFILE and RADKFILE.
45 SetOutPath "$INSTDIR\dicts"
46 File "J-Ben\dicts\README.txt"
47 File "J-Ben\dicts\edict2"
48 File "J-Ben\dicts\kanjidic"
49 File "J-Ben\dicts\kradfile"
50 File "J-Ben\dicts\radkfile"
52 # Program Files\J-Ben\sods
53 # No SODs are loaded by default; this is an optional component.
54 # The only file to be copied is a readme.
55 SetOutPath "$INSTDIR\sods"
56 File "J-Ben\sods\README.txt"
58 # Write registry settings and make uninstaller
59 WriteRegStr HKLM \
60 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
61 "DisplayName" "J-Ben"
62 WriteRegStr HKLM \
63 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
64 "UninstallString" "$INSTDIR\uninstall.exe"
65 WriteRegStr HKLM \
66 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
67 "InstallLocation" "$INSTDIR"
68 WriteRegStr HKLM \
69 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
70 "DisplayIcon" "$INSTDIR\jben.exe"
71 WriteUninstaller "$INSTDIR\uninstall.exe"
72 SectionEnd
74 Section "Create Start Menu Icons"
75 SetOutPath "$INSTDIR"
76 CreateDirectory "$SMPROGRAMS\J-Ben"
77 CreateShortcut "$SMPROGRAMS\J-Ben\J-Ben.lnk" "$INSTDIR\jben.exe"
78 CreateShortcut "$SMPROGRAMS\J-Ben\Uninstall J-Ben.lnk" "$INSTDIR\uninstall.exe"
79 SectionEnd
81 Section /o "Create Desktop Icon"
82 SetOutPath "$INSTDIR"
83 CreateShortcut "$DESKTOP\J-Ben.lnk" "$INSTDIR\jben.exe"
84 SectionEnd
86 ;Section "J-Ben Documentation"
87 ;SectionEnd
89 ;Section "J-Ben Source Code"
90 ;SectionEnd
92 Section "un.J-Ben Core"
93 # Program Files\J-Ben
94 SetOutPath "$INSTDIR"
95 Delete "jben.exe"
96 Delete "jben_kpengine.exe"
97 Delete "libcharset1.dll"
98 Delete "libiconv2.dll"
99 Delete "libstlport.5.1.dll"
100 Delete "mingwm10.dll"
101 Delete "wxbase28u_gcc_vultaire.net.dll"
102 Delete "wxmsw28u_core_gcc_vultaire.net.dll"
103 Delete "wxmsw28u_html_gcc_vultaire.net.dll"
104 Delete "README.txt"
105 Delete "CHANGELOG.txt"
106 RMDir /r "$INSTDIR\kpengine_data"
107 RMDir /r "$INSTDIR\license"
109 # Program Files\J-Ben\dicts
110 # By default, we install EDICT2, KANJIDIC, KRADFILE and RADKFILE.
111 Delete "dicts\README.txt"
112 Delete "dicts\edict2"
113 Delete "dicts\kanjidic"
114 Delete "dicts\kradfile"
115 Delete "dicts\radkfile"
116 RMDir "$INSTDIR\dicts"
118 # Program Files\J-Ben\sods
119 # No SODs are loaded by default; this is an optional component.
120 # The only file to be copied is a readme.
121 Delete "sods\README.txt"
122 RMDir "$INSTDIR\sods"
124 Delete "uninstall.exe"
125 SetOutPath "$INSTDIR\.."
126 RMDir "$INSTDIR"
128 DeleteRegKey HKLM \
129 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben"
130 SectionEnd
132 Section "un.Start Menu and Desktop Shortcuts"
133 Delete "$SMPROGRAMS\J-Ben\J-Ben.lnk"
134 Delete "$SMPROGRAMS\J-Ben\Uninstall J-Ben.lnk"
135 RMDir "$SMPROGRAMS\J-Ben"
136 Delete "$DESKTOP\J-Ben.lnk"
137 SectionEnd