aboutsummaryrefslogtreecommitdiff
path: root/release/libjpeg-turbo.nsi.in
blob: 6eb4bae6bd6e55df2d203e250227c8f6ce63e9cc (plain)
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
133
134
135
136
137
138
139
140
141
!include x64.nsh
Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
OutFile "@CMAKE_BINARY_DIR@\${BUILDDIR}@INST_NAME@.exe"
InstallDir c:\@INST_DIR@

SetCompressor bzip2

Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
!ifdef WIN64
	${If} ${RunningX64}
	${DisableX64FSRedirection}
	${Endif}
!endif
	SectionIn RO
!ifdef GCC
	IfFileExists $SYSDIR/libturbojpeg.dll exists 0
!else
	IfFileExists $SYSDIR/turbojpeg.dll exists 0
!endif
	goto notexists
	exists:
!ifdef GCC
	MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed.  Please uninstall it first."
!else
	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."
!endif
	quit

	notexists:
	SetOutPath $SYSDIR
!ifdef GCC
	File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
!else
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
!endif
	SetOutPath $INSTDIR\bin
!ifdef GCC
	File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll" 
!else
	File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll"
!endif
	File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe"
	File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe"
	File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpegtran.exe"
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpgtest.exe"
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
	SetOutPath $INSTDIR\lib
!ifdef GCC
	File "@CMAKE_BINARY_DIR@\libturbojpeg.dll.a"
	File "@CMAKE_BINARY_DIR@\libturbojpeg.a"
	File "@CMAKE_BINARY_DIR@\sharedlib\libjpeg.dll.a"
	File "@CMAKE_BINARY_DIR@\libjpeg.a"
!else
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
	File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg.lib"
	File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
!endif
	SetOutPath $INSTDIR\include
	File "@CMAKE_BINARY_DIR@\jconfig.h"
	File "@CMAKE_SOURCE_DIR@\jerror.h"
	File "@CMAKE_SOURCE_DIR@\jmorecfg.h"
	File "@CMAKE_SOURCE_DIR@\jpeglib.h"
	File "@CMAKE_SOURCE_DIR@\turbojpeg.h"
	SetOutPath $INSTDIR\doc
	File "@CMAKE_SOURCE_DIR@\README"
	File "@CMAKE_SOURCE_DIR@\README-turbo.txt"
	File "@CMAKE_SOURCE_DIR@\libjpeg.txt"
	File "@CMAKE_SOURCE_DIR@\LGPL.txt"
	File "@CMAKE_SOURCE_DIR@\LICENSE.txt"
	File "@CMAKE_SOURCE_DIR@\usage.txt"

	WriteRegStr HKLM "SOFTWARE\@INST_DIR@ @VERSION@" "Install_Dir" "$INSTDIR"

	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_DIR@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@"
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_DIR@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@VERSION@.exe"'
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_DIR@ @VERSION@" "NoModify" 1
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_DIR@ @VERSION@" "NoRepair" 1
	WriteUninstaller "uninstall_@VERSION@.exe"
SectionEnd

Section "Uninstall"
!ifdef WIN64
	${If} ${RunningX64}
	${DisableX64FSRedirection}
	${Endif}
!endif

	SetShellVarContext all

	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_DIR@ @VERSION@"
	DeleteRegKey HKLM "SOFTWARE\@INST_DIR@ @VERSION@"

!ifdef GCC
	Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll
	Delete $SYSDIR\libturbojpeg.dll
	Delete $INSTDIR\lib\libturbojpeg.dll.a"
	Delete $INSTDIR\lib\libturbojpeg.a"
	Delete $INSTDIR\lib\libjpeg.dll.a"
	Delete $INSTDIR\lib\libjpeg.a"
!else
	Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll
	Delete $SYSDIR\turbojpeg.dll
	Delete $INSTDIR\lib\jpeg.lib
	Delete $INSTDIR\lib\jpeg-static.lib
	Delete $INSTDIR\lib\turbojpeg.lib
	Delete $INSTDIR\lib\turbojpeg-static.lib
!endif
	Delete $INSTDIR\bin\cjpeg.exe
	Delete $INSTDIR\bin\djpeg.exe
	Delete $INSTDIR\bin\jpegtran.exe
	Delete $INSTDIR\bin\jpgtest.exe
	Delete $INSTDIR\bin\rdjpgcom.exe
	Delete $INSTDIR\bin\wrjpgcom.exe
	Delete $INSTDIR\include\jconfig.h"
	Delete $INSTDIR\include\jerror.h"
	Delete $INSTDIR\include\jmorecfg.h"
	Delete $INSTDIR\include\jpeglib.h"
	Delete $INSTDIR\include\turbojpeg.h"
	Delete $INSTDIR\uninstall_@VERSION@.exe
	Delete $INSTDIR\doc\README
	Delete $INSTDIR\doc\README-turbo.txt
	Delete $INSTDIR\doc\libjpeg.txt
	Delete $INSTDIR\doc\LGPL.txt
	Delete $INSTDIR\doc\LICENSE.txt
	Delete $INSTDIR\doc\usage.txt

	RMDir "$INSTDIR\include"
	RMDir "$INSTDIR\lib"
	RMDir "$INSTDIR\doc"
	RMDir "$INSTDIR\bin"
	RMDir "$INSTDIR"

SectionEnd