blob: c675eac2a5c7d6afc06162043405336affd2db26 [file] [log] [blame]
DRC2c0a4e12010-10-16 08:51:43 +00001!include x64.nsh
2Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
DRCc0a1cba2010-10-18 09:46:27 +00003OutFile "@CMAKE_BINARY_DIR@\${BUILDDIR}@INST_NAME@.exe"
DRC7175e512013-04-23 22:29:00 +00004InstallDir @INST_DIR@
DRC2c0a4e12010-10-16 08:51:43 +00005
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
DRC441308c2013-04-24 05:26:42 +000022 IfFileExists $SYSDIR/libturbojpeg.dll exists 0
DRC2c0a4e12010-10-16 08:51:43 +000023!else
DRC441308c2013-04-24 05:26:42 +000024 IfFileExists $SYSDIR/turbojpeg.dll exists 0
DRC2c0a4e12010-10-16 08:51:43 +000025!endif
26 goto notexists
27 exists:
DRC441308c2013-04-24 05:26:42 +000028!ifdef GCC
DRC2c0a4e12010-10-16 08:51:43 +000029 MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed. Please uninstall it first."
DRC441308c2013-04-24 05:26:42 +000030!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
DRC2c0a4e12010-10-16 08:51:43 +000033 quit
34
35 notexists:
DRC441308c2013-04-24 05:26:42 +000036 SetOutPath $SYSDIR
37!ifdef GCC
38 File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
39!else
40 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
41!endif
DRC2c0a4e12010-10-16 08:51:43 +000042 SetOutPath $INSTDIR\bin
43!ifdef GCC
DRC4d877932013-09-19 22:55:57 +000044 File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
45!else
46 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
47!endif
48!ifdef GCC
DRCeca06372014-11-06 09:32:38 +000049 File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll"
DRC2c0a4e12010-10-16 08:51:43 +000050!else
51 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll"
52!endif
DRC01fa0312011-04-01 11:10:46 +000053 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe"
54 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe"
55 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpegtran.exe"
DRC3185cb92011-05-25 03:52:22 +000056 File "@CMAKE_BINARY_DIR@\${BUILDDIR}tjbench.exe"
DRC01fa0312011-04-01 11:10:46 +000057 File "@CMAKE_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
58 File "@CMAKE_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
DRC2c0a4e12010-10-16 08:51:43 +000059 SetOutPath $INSTDIR\lib
60!ifdef GCC
61 File "@CMAKE_BINARY_DIR@\libturbojpeg.dll.a"
62 File "@CMAKE_BINARY_DIR@\libturbojpeg.a"
63 File "@CMAKE_BINARY_DIR@\sharedlib\libjpeg.dll.a"
64 File "@CMAKE_BINARY_DIR@\libjpeg.a"
65!else
66 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
67 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
68 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg.lib"
69 File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
70!endif
DRC957d6232011-04-01 11:13:11 +000071!ifdef JAVA
72 SetOutPath $INSTDIR\classes
73 File "@CMAKE_BINARY_DIR@\java\${BUILDDIR}turbojpeg.jar"
74!endif
DRC2c0a4e12010-10-16 08:51:43 +000075 SetOutPath $INSTDIR\include
76 File "@CMAKE_BINARY_DIR@\jconfig.h"
77 File "@CMAKE_SOURCE_DIR@\jerror.h"
78 File "@CMAKE_SOURCE_DIR@\jmorecfg.h"
79 File "@CMAKE_SOURCE_DIR@\jpeglib.h"
80 File "@CMAKE_SOURCE_DIR@\turbojpeg.h"
DRC8569c2f2011-02-18 23:49:42 +000081 SetOutPath $INSTDIR\doc
DRC2c0a4e12010-10-16 08:51:43 +000082 File "@CMAKE_SOURCE_DIR@\README"
83 File "@CMAKE_SOURCE_DIR@\README-turbo.txt"
DRCa1647c82012-02-10 00:39:05 +000084 File "@CMAKE_SOURCE_DIR@\example.c"
DRC2c0a4e12010-10-16 08:51:43 +000085 File "@CMAKE_SOURCE_DIR@\libjpeg.txt"
DRCa1647c82012-02-10 00:39:05 +000086 File "@CMAKE_SOURCE_DIR@\structure.txt"
DRC8569c2f2011-02-18 23:49:42 +000087 File "@CMAKE_SOURCE_DIR@\usage.txt"
DRCa1647c82012-02-10 00:39:05 +000088 File "@CMAKE_SOURCE_DIR@\wizard.txt"
DRC2c0a4e12010-10-16 08:51:43 +000089
DRC7175e512013-04-23 22:29:00 +000090 WriteRegStr HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@" "Install_Dir" "$INSTDIR"
DRC2c0a4e12010-10-16 08:51:43 +000091
DRC7175e512013-04-23 22:29:00 +000092 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@"
93 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@VERSION@.exe"'
94 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoModify" 1
95 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoRepair" 1
DRC2c0a4e12010-10-16 08:51:43 +000096 WriteUninstaller "uninstall_@VERSION@.exe"
97SectionEnd
98
99Section "Uninstall"
100!ifdef WIN64
101 ${If} ${RunningX64}
102 ${DisableX64FSRedirection}
103 ${Endif}
104!endif
105
106 SetShellVarContext all
107
DRC7175e512013-04-23 22:29:00 +0000108 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@"
109 DeleteRegKey HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@"
DRC2c0a4e12010-10-16 08:51:43 +0000110
111!ifdef GCC
112 Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll
DRCc4930d82015-01-07 01:19:49 +0000113 Delete $INSTDIR\bin\libturbojpeg.dll
DRC441308c2013-04-24 05:26:42 +0000114 Delete $SYSDIR\libturbojpeg.dll
DRC2c0a4e12010-10-16 08:51:43 +0000115 Delete $INSTDIR\lib\libturbojpeg.dll.a"
116 Delete $INSTDIR\lib\libturbojpeg.a"
117 Delete $INSTDIR\lib\libjpeg.dll.a"
118 Delete $INSTDIR\lib\libjpeg.a"
119!else
120 Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll
DRCc4930d82015-01-07 01:19:49 +0000121 Delete $INSTDIR\bin\turbojpeg.dll
DRC441308c2013-04-24 05:26:42 +0000122 Delete $SYSDIR\turbojpeg.dll
DRC2c0a4e12010-10-16 08:51:43 +0000123 Delete $INSTDIR\lib\jpeg.lib
124 Delete $INSTDIR\lib\jpeg-static.lib
125 Delete $INSTDIR\lib\turbojpeg.lib
126 Delete $INSTDIR\lib\turbojpeg-static.lib
127!endif
DRC957d6232011-04-01 11:13:11 +0000128!ifdef JAVA
129 Delete $INSTDIR\classes\turbojpeg.jar
130!endif
DRC8569c2f2011-02-18 23:49:42 +0000131 Delete $INSTDIR\bin\cjpeg.exe
132 Delete $INSTDIR\bin\djpeg.exe
133 Delete $INSTDIR\bin\jpegtran.exe
DRC3185cb92011-05-25 03:52:22 +0000134 Delete $INSTDIR\bin\tjbench.exe
DRC8569c2f2011-02-18 23:49:42 +0000135 Delete $INSTDIR\bin\rdjpgcom.exe
136 Delete $INSTDIR\bin\wrjpgcom.exe
DRC2c0a4e12010-10-16 08:51:43 +0000137 Delete $INSTDIR\include\jconfig.h"
138 Delete $INSTDIR\include\jerror.h"
139 Delete $INSTDIR\include\jmorecfg.h"
140 Delete $INSTDIR\include\jpeglib.h"
141 Delete $INSTDIR\include\turbojpeg.h"
142 Delete $INSTDIR\uninstall_@VERSION@.exe
DRC8569c2f2011-02-18 23:49:42 +0000143 Delete $INSTDIR\doc\README
144 Delete $INSTDIR\doc\README-turbo.txt
DRCa1647c82012-02-10 00:39:05 +0000145 Delete $INSTDIR\doc\example.c
DRC8569c2f2011-02-18 23:49:42 +0000146 Delete $INSTDIR\doc\libjpeg.txt
DRCa1647c82012-02-10 00:39:05 +0000147 Delete $INSTDIR\doc\structure.txt
DRC8569c2f2011-02-18 23:49:42 +0000148 Delete $INSTDIR\doc\usage.txt
DRCa1647c82012-02-10 00:39:05 +0000149 Delete $INSTDIR\doc\wizard.txt
DRC2c0a4e12010-10-16 08:51:43 +0000150
151 RMDir "$INSTDIR\include"
152 RMDir "$INSTDIR\lib"
DRC8569c2f2011-02-18 23:49:42 +0000153 RMDir "$INSTDIR\doc"
DRC957d6232011-04-01 11:13:11 +0000154!ifdef JAVA
155 RMDir "$INSTDIR\classes"
156!endif
DRC2c0a4e12010-10-16 08:51:43 +0000157 RMDir "$INSTDIR\bin"
158 RMDir "$INSTDIR"
159
160SectionEnd