summaryrefslogtreecommitdiff
path: root/trunk/release/libjpeg-turbo.nsi.in
blob: 39b85d261e028cbc6d3bbfd26c3e6140a7f13ac6 (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
!include x64.nsh
Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
OutFile "@CMAKE_BINARY_DIR@\${BUILDDIR}@INST_NAME@.exe"
InstallDir c:\@INST_NAME@

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
	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
	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"

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

	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_NAME@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@"
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_NAME@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@VERSION@.exe"'
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_NAME@ @VERSION@" "NoModify" 1
	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_NAME@ @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_NAME@ @VERSION@"
	DeleteRegKey HKLM "SOFTWARE\@INST_NAME@ @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\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\README
	Delete $INSTDIR\README-turbo.txt
	Delete $INSTDIR\libjpeg.txt
	Delete $INSTDIR\LGPL.txt
	Delete $INSTDIR\LICENSE.txt

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

SectionEnd