libjpeg-turbo.nsi.in 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. !include x64.nsh
  2. Name "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@"
  3. OutFile "@CMAKE_BINARY_DIR@\${BUILDDIR}@[email protected]"
  4. InstallDir @INST_DIR@
  5. SetCompressor bzip2
  6. Page directory
  7. Page instfiles
  8. UninstPage uninstConfirm
  9. UninstPage instfiles
  10. Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
  11. !ifdef WIN64
  12. ${If} ${RunningX64}
  13. ${DisableX64FSRedirection}
  14. ${Endif}
  15. !endif
  16. SectionIn RO
  17. !ifdef GCC
  18. IfFileExists $SYSDIR/libturbojpeg.dll exists 0
  19. !else
  20. IfFileExists $SYSDIR/turbojpeg.dll exists 0
  21. !endif
  22. goto notexists
  23. exists:
  24. !ifdef GCC
  25. MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed. Please uninstall it first."
  26. !else
  27. 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."
  28. !endif
  29. quit
  30. notexists:
  31. SetOutPath $SYSDIR
  32. !ifdef GCC
  33. File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
  34. !else
  35. File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
  36. !endif
  37. SetOutPath $INSTDIR\bin
  38. !ifdef GCC
  39. File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
  40. !else
  41. File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
  42. !endif
  43. !ifdef GCC
  44. File "/oname=libjpeg-@[email protected]" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll"
  45. !else
  46. File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@[email protected]"
  47. !endif
  48. File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe"
  49. File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe"
  50. File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpegtran.exe"
  51. File "@CMAKE_BINARY_DIR@\${BUILDDIR}tjbench.exe"
  52. File "@CMAKE_BINARY_DIR@\${BUILDDIR}rdjpgcom.exe"
  53. File "@CMAKE_BINARY_DIR@\${BUILDDIR}wrjpgcom.exe"
  54. SetOutPath $INSTDIR\lib
  55. !ifdef GCC
  56. File "@CMAKE_BINARY_DIR@\libturbojpeg.dll.a"
  57. File "@CMAKE_BINARY_DIR@\libturbojpeg.a"
  58. File "@CMAKE_BINARY_DIR@\sharedlib\libjpeg.dll.a"
  59. File "@CMAKE_BINARY_DIR@\libjpeg.a"
  60. !else
  61. File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.lib"
  62. File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg-static.lib"
  63. File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg.lib"
  64. File "@CMAKE_BINARY_DIR@\${BUILDDIR}jpeg-static.lib"
  65. !endif
  66. !ifdef JAVA
  67. SetOutPath $INSTDIR\classes
  68. File "@CMAKE_BINARY_DIR@\java\${BUILDDIR}turbojpeg.jar"
  69. !endif
  70. SetOutPath $INSTDIR\include
  71. File "@CMAKE_BINARY_DIR@\jconfig.h"
  72. File "@CMAKE_SOURCE_DIR@\jerror.h"
  73. File "@CMAKE_SOURCE_DIR@\jmorecfg.h"
  74. File "@CMAKE_SOURCE_DIR@\jpeglib.h"
  75. File "@CMAKE_SOURCE_DIR@\turbojpeg.h"
  76. SetOutPath $INSTDIR\doc
  77. File "@CMAKE_SOURCE_DIR@\README.ijg"
  78. File "@CMAKE_SOURCE_DIR@\README.md"
  79. File "@CMAKE_SOURCE_DIR@\LICENSE.md"
  80. File "@CMAKE_SOURCE_DIR@\example.c"
  81. File "@CMAKE_SOURCE_DIR@\libjpeg.txt"
  82. File "@CMAKE_SOURCE_DIR@\structure.txt"
  83. File "@CMAKE_SOURCE_DIR@\usage.txt"
  84. File "@CMAKE_SOURCE_DIR@\wizard.txt"
  85. WriteRegStr HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@" "Install_Dir" "$INSTDIR"
  86. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "DisplayName" "@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@"
  87. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "UninstallString" '"$INSTDIR\uninstall_@[email protected]"'
  88. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoModify" 1
  89. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@" "NoRepair" 1
  90. WriteUninstaller "uninstall_@[email protected]"
  91. SectionEnd
  92. Section "Uninstall"
  93. !ifdef WIN64
  94. ${If} ${RunningX64}
  95. ${DisableX64FSRedirection}
  96. ${Endif}
  97. !endif
  98. SetShellVarContext all
  99. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@INST_REG_NAME@ @VERSION@"
  100. DeleteRegKey HKLM "SOFTWARE\@INST_REG_NAME@ @VERSION@"
  101. !ifdef GCC
  102. Delete $INSTDIR\bin\libjpeg-@[email protected]
  103. Delete $INSTDIR\bin\libturbojpeg.dll
  104. Delete $SYSDIR\libturbojpeg.dll
  105. Delete $INSTDIR\lib\libturbojpeg.dll.a"
  106. Delete $INSTDIR\lib\libturbojpeg.a"
  107. Delete $INSTDIR\lib\libjpeg.dll.a"
  108. Delete $INSTDIR\lib\libjpeg.a"
  109. !else
  110. Delete $INSTDIR\bin\jpeg@[email protected]
  111. Delete $INSTDIR\bin\turbojpeg.dll
  112. Delete $SYSDIR\turbojpeg.dll
  113. Delete $INSTDIR\lib\jpeg.lib
  114. Delete $INSTDIR\lib\jpeg-static.lib
  115. Delete $INSTDIR\lib\turbojpeg.lib
  116. Delete $INSTDIR\lib\turbojpeg-static.lib
  117. !endif
  118. !ifdef JAVA
  119. Delete $INSTDIR\classes\turbojpeg.jar
  120. !endif
  121. Delete $INSTDIR\bin\cjpeg.exe
  122. Delete $INSTDIR\bin\djpeg.exe
  123. Delete $INSTDIR\bin\jpegtran.exe
  124. Delete $INSTDIR\bin\tjbench.exe
  125. Delete $INSTDIR\bin\rdjpgcom.exe
  126. Delete $INSTDIR\bin\wrjpgcom.exe
  127. Delete $INSTDIR\include\jconfig.h"
  128. Delete $INSTDIR\include\jerror.h"
  129. Delete $INSTDIR\include\jmorecfg.h"
  130. Delete $INSTDIR\include\jpeglib.h"
  131. Delete $INSTDIR\include\turbojpeg.h"
  132. Delete $INSTDIR\uninstall_@[email protected]
  133. Delete $INSTDIR\doc\README.ijg
  134. Delete $INSTDIR\doc\README.md
  135. Delete $INSTDIR\doc\LICENSE.md
  136. Delete $INSTDIR\doc\example.c
  137. Delete $INSTDIR\doc\libjpeg.txt
  138. Delete $INSTDIR\doc\structure.txt
  139. Delete $INSTDIR\doc\usage.txt
  140. Delete $INSTDIR\doc\wizard.txt
  141. RMDir "$INSTDIR\include"
  142. RMDir "$INSTDIR\lib"
  143. RMDir "$INSTDIR\doc"
  144. !ifdef JAVA
  145. RMDir "$INSTDIR\classes"
  146. !endif
  147. RMDir "$INSTDIR\bin"
  148. RMDir "$INSTDIR"
  149. SectionEnd