1 !include x64.nsh 2 Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@" 3 OutFile "@CMAKE_BINARY_DIR@\${BUILDDIR}@INST_NAME@.exe" 4 InstallDir @INST_DIR@ 5 6 SetCompressor bzip2 7 8 Page directory 9 Page instfiles 10 11 UninstPage uninstConfirm 12 UninstPage instfiles 13 14 Section "@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_BINARY_DIR@\libturbojpeg.dll" 39 !else 40 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll" 41 !endif 42 SetOutPath $INSTDIR\bin 43 !ifdef GCC 44 File "@CMAKE_BINARY_DIR@\libturbojpeg.dll" 45 !else 46 File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll" 47 !endif 48 !ifdef GCC 49 File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll" 50 !else 51 File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll" 52 !endif 53 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" 56 File "@CMAKE_BINARY_DIR@\${BUILDDIR}tjbench.exe" 57 File "@CMAKE_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe" 58 File "@CMAKE_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe" 59 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 71 !ifdef JAVA 72 SetOutPath $INSTDIR\classes 73 File "@CMAKE_BINARY_DIR@\java\${BUILDDIR}turbojpeg.jar" 74 !endif 75 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" 81 SetOutPath $INSTDIR\doc 82 File "@CMAKE_SOURCE_DIR@\README.ijg" 83 File "@CMAKE_SOURCE_DIR@\README.md" 84 File "@CMAKE_SOURCE_DIR@\LICENSE.md" 85 File "@CMAKE_SOURCE_DIR@\example.c" 86 File "@CMAKE_SOURCE_DIR@\libjpeg.txt" 87 File "@CMAKE_SOURCE_DIR@\structure.txt" 88 File "@CMAKE_SOURCE_DIR@\usage.txt" 89 File "@CMAKE_SOURCE_DIR@\wizard.txt" 90 91 WriteRegStr HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@" "Install_Dir" "$INSTDIR" 92 93 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@" 94 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@VERSION@.exe"' 95 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoModify" 1 96 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoRepair" 1 97 WriteUninstaller "uninstall_@VERSION@.exe" 98 SectionEnd 99 100 Section "Uninstall" 101 !ifdef WIN64 102 ${If} ${RunningX64} 103 ${DisableX64FSRedirection} 104 ${Endif} 105 !endif 106 107 SetShellVarContext all 108 109 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" 110 DeleteRegKey HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@" 111 112 !ifdef GCC 113 Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll 114 Delete $INSTDIR\bin\libturbojpeg.dll 115 Delete $SYSDIR\libturbojpeg.dll 116 Delete $INSTDIR\lib\libturbojpeg.dll.a" 117 Delete $INSTDIR\lib\libturbojpeg.a" 118 Delete $INSTDIR\lib\libjpeg.dll.a" 119 Delete $INSTDIR\lib\libjpeg.a" 120 !else 121 Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll 122 Delete $INSTDIR\bin\turbojpeg.dll 123 Delete $SYSDIR\turbojpeg.dll 124 Delete $INSTDIR\lib\jpeg.lib 125 Delete $INSTDIR\lib\jpeg-static.lib 126 Delete $INSTDIR\lib\turbojpeg.lib 127 Delete $INSTDIR\lib\turbojpeg-static.lib 128 !endif 129 !ifdef JAVA 130 Delete $INSTDIR\classes\turbojpeg.jar 131 !endif 132 Delete $INSTDIR\bin\cjpeg.exe 133 Delete $INSTDIR\bin\djpeg.exe 134 Delete $INSTDIR\bin\jpegtran.exe 135 Delete $INSTDIR\bin\tjbench.exe 136 Delete $INSTDIR\bin\rdjpgcom.exe 137 Delete $INSTDIR\bin\wrjpgcom.exe 138 Delete $INSTDIR\include\jconfig.h" 139 Delete $INSTDIR\include\jerror.h" 140 Delete $INSTDIR\include\jmorecfg.h" 141 Delete $INSTDIR\include\jpeglib.h" 142 Delete $INSTDIR\include\turbojpeg.h" 143 Delete $INSTDIR\uninstall_@VERSION@.exe 144 Delete $INSTDIR\doc\README.ijg 145 Delete $INSTDIR\doc\README.md 146 Delete $INSTDIR\doc\LICENSE.md 147 Delete $INSTDIR\doc\example.c 148 Delete $INSTDIR\doc\libjpeg.txt 149 Delete $INSTDIR\doc\structure.txt 150 Delete $INSTDIR\doc\usage.txt 151 Delete $INSTDIR\doc\wizard.txt 152 153 RMDir "$INSTDIR\include" 154 RMDir "$INSTDIR\lib" 155 RMDir "$INSTDIR\doc" 156 !ifdef JAVA 157 RMDir "$INSTDIR\classes" 158 !endif 159 RMDir "$INSTDIR\bin" 160 RMDir "$INSTDIR" 161 162 SectionEnd 163