• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1!include x64.nsh
2Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
3OutFile "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}@INST_NAME@.exe"
4InstallDir "@INST_DIR@"
5
6SetCompressor bzip2
7
8Page directory
9Page instfiles
10
11UninstPage uninstConfirm
12UninstPage instfiles
13
14Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
15!ifdef WIN64
16	${If} ${RunningX64}
17	${DisableX64FSRedirection}
18	${Endif}
19!endif
20	SectionIn RO
21!ifdef GCC
22	IfFileExists $SYSDIR/libturbojpeg.dll exists 0
23!else
24	IfFileExists $SYSDIR/turbojpeg.dll exists 0
25!endif
26	goto notexists
27	exists:
28!ifdef GCC
29	MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed.  Please uninstall it first."
30!else
31	MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ or the TurboJPEG SDK is already installed.  Please uninstall it first."
32!endif
33	quit
34
35	notexists:
36	SetOutPath $SYSDIR
37!ifdef GCC
38	File "@CMAKE_CURRENT_BINARY_DIR@\libturbojpeg.dll"
39!else
40	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
41!endif
42	SetOutPath $INSTDIR\bin
43!ifdef GCC
44	File "@CMAKE_CURRENT_BINARY_DIR@\libturbojpeg.dll"
45!else
46	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
47!endif
48!ifdef GCC
49	File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg-@SO_MAJOR_VERSION@.dll"
50!else
51	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg@SO_MAJOR_VERSION@.dll"
52!endif
53	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}cjpeg.exe"
54	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}djpeg.exe"
55	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpegtran.exe"
56	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}tjbench.exe"
57	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
58	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
59	SetOutPath $INSTDIR\lib
60!ifdef GCC
61	File "@CMAKE_CURRENT_BINARY_DIR@\libturbojpeg.dll.a"
62	File "@CMAKE_CURRENT_BINARY_DIR@\libturbojpeg.a"
63	File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg.dll.a"
64	File "@CMAKE_CURRENT_BINARY_DIR@\libjpeg.a"
65!else
66	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
67	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
68	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg.lib"
69	File "@CMAKE_CURRENT_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
70!endif
71	SetOutPath $INSTDIR\lib\pkgconfig
72	File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\libjpeg.pc"
73	File "@CMAKE_CURRENT_BINARY_DIR@\pkgscripts\libturbojpeg.pc"
74!ifdef JAVA
75	SetOutPath $INSTDIR\classes
76	File "@CMAKE_CURRENT_BINARY_DIR@\java\turbojpeg.jar"
77!endif
78	SetOutPath $INSTDIR\include
79	File "@CMAKE_CURRENT_BINARY_DIR@\jconfig.h"
80	File "@CMAKE_CURRENT_SOURCE_DIR@\jerror.h"
81	File "@CMAKE_CURRENT_SOURCE_DIR@\jmorecfg.h"
82	File "@CMAKE_CURRENT_SOURCE_DIR@\jpeglib.h"
83	File "@CMAKE_CURRENT_SOURCE_DIR@\turbojpeg.h"
84	SetOutPath $INSTDIR\doc
85	File "@CMAKE_CURRENT_SOURCE_DIR@\README.ijg"
86	File "@CMAKE_CURRENT_SOURCE_DIR@\README.md"
87	File "@CMAKE_CURRENT_SOURCE_DIR@\LICENSE.md"
88	File "@CMAKE_CURRENT_SOURCE_DIR@\example.txt"
89	File "@CMAKE_CURRENT_SOURCE_DIR@\libjpeg.txt"
90	File "@CMAKE_CURRENT_SOURCE_DIR@\structure.txt"
91	File "@CMAKE_CURRENT_SOURCE_DIR@\usage.txt"
92	File "@CMAKE_CURRENT_SOURCE_DIR@\wizard.txt"
93	File "@CMAKE_CURRENT_SOURCE_DIR@\tjexample.c"
94	File "@CMAKE_CURRENT_SOURCE_DIR@\java\TJExample.java"
95!ifdef GCC
96	SetOutPath $INSTDIR\man\man1
97	File "@CMAKE_CURRENT_SOURCE_DIR@\cjpeg.1"
98	File "@CMAKE_CURRENT_SOURCE_DIR@\djpeg.1"
99	File "@CMAKE_CURRENT_SOURCE_DIR@\jpegtran.1"
100	File "@CMAKE_CURRENT_SOURCE_DIR@\rdjpgcom.1"
101	File "@CMAKE_CURRENT_SOURCE_DIR@\wrjpgcom.1"
102!endif
103
104	WriteRegStr HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@" "Install_Dir" "$INSTDIR"
105
106	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@"
107	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@VERSION@.exe"'
108	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoModify" 1
109	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoRepair" 1
110	WriteUninstaller "uninstall_@VERSION@.exe"
111SectionEnd
112
113Section "Uninstall"
114!ifdef WIN64
115	${If} ${RunningX64}
116	${DisableX64FSRedirection}
117	${Endif}
118!endif
119
120	SetShellVarContext all
121
122	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@"
123	DeleteRegKey HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@"
124
125!ifdef GCC
126	Delete $INSTDIR\bin\libjpeg-@SO_MAJOR_VERSION@.dll
127	Delete $INSTDIR\bin\libturbojpeg.dll
128	Delete $SYSDIR\libturbojpeg.dll
129	Delete $INSTDIR\lib\libturbojpeg.dll.a
130	Delete $INSTDIR\lib\libturbojpeg.a
131	Delete $INSTDIR\lib\libjpeg.dll.a
132	Delete $INSTDIR\lib\libjpeg.a
133!else
134	Delete $INSTDIR\bin\jpeg@SO_MAJOR_VERSION@.dll
135	Delete $INSTDIR\bin\turbojpeg.dll
136	Delete $SYSDIR\turbojpeg.dll
137	Delete $INSTDIR\lib\jpeg.lib
138	Delete $INSTDIR\lib\jpeg-static.lib
139	Delete $INSTDIR\lib\turbojpeg.lib
140	Delete $INSTDIR\lib\turbojpeg-static.lib
141!endif
142	Delete $INSTDIR\lib\pkgconfig\libjpeg.pc
143	Delete $INSTDIR\lib\pkgconfig\libturbojpeg.pc
144!ifdef JAVA
145	Delete $INSTDIR\classes\turbojpeg.jar
146!endif
147	Delete $INSTDIR\bin\cjpeg.exe
148	Delete $INSTDIR\bin\djpeg.exe
149	Delete $INSTDIR\bin\jpegtran.exe
150	Delete $INSTDIR\bin\tjbench.exe
151	Delete $INSTDIR\bin\rdjpgcom.exe
152	Delete $INSTDIR\bin\wrjpgcom.exe
153	Delete $INSTDIR\include\jconfig.h
154	Delete $INSTDIR\include\jerror.h
155	Delete $INSTDIR\include\jmorecfg.h
156	Delete $INSTDIR\include\jpeglib.h
157	Delete $INSTDIR\include\turbojpeg.h
158	Delete $INSTDIR\uninstall_@VERSION@.exe
159	Delete $INSTDIR\doc\README.ijg
160	Delete $INSTDIR\doc\README.md
161	Delete $INSTDIR\doc\LICENSE.md
162	Delete $INSTDIR\doc\example.txt
163	Delete $INSTDIR\doc\libjpeg.txt
164	Delete $INSTDIR\doc\structure.txt
165	Delete $INSTDIR\doc\usage.txt
166	Delete $INSTDIR\doc\wizard.txt
167	Delete $INSTDIR\doc\tjexample.c
168	Delete $INSTDIR\doc\TJExample.java
169!ifdef GCC
170	Delete $INSTDIR\man\man1\cjpeg.1
171	Delete $INSTDIR\man\man1\djpeg.1
172	Delete $INSTDIR\man\man1\jpegtran.1
173	Delete $INSTDIR\man\man1\rdjpgcom.1
174	Delete $INSTDIR\man\man1\wrjpgcom.1
175!endif
176
177	RMDir "$INSTDIR\include"
178	RMDir "$INSTDIR\lib\pkgconfig"
179	RMDir "$INSTDIR\lib"
180	RMDir "$INSTDIR\doc"
181!ifdef GCC
182	RMDir "$INSTDIR\man\man1"
183	RMDir "$INSTDIR\man"
184!endif
185!ifdef JAVA
186	RMDir "$INSTDIR\classes"
187!endif
188	RMDir "$INSTDIR\bin"
189	RMDir "$INSTDIR"
190
191SectionEnd
192