tor-mingw.nsi.in 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. ;tor.nsi - A basic win32 installer for Tor
  2. ; Originally written by J Doe.
  3. ; See LICENSE for licencing information
  4. ;-----------------------------------------
  5. ;
  6. !include "MUI.nsh"
  7. !define VERSION "0.1.2.2-alpha"
  8. !define INSTALLER "tor-${VERSION}-win32.exe"
  9. !define WEBSITE "http://tor.eff.org/"
  10. !define LICENSE "LICENSE"
  11. ;BIN is where it expects to find tor.exe, tor-resolve.exe, libcrypto.a
  12. ;and libssl.a
  13. !define BIN "..\bin"
  14. SetCompressor lzma
  15. ;SetCompressor zlib
  16. OutFile ${INSTALLER}
  17. InstallDir $PROGRAMFILES\Tor
  18. SetOverWrite ifnewer
  19. Name "Tor"
  20. Caption "Tor ${VERSION} Setup"
  21. BrandingText "The Onion Router"
  22. CRCCheck on
  23. XPStyle on
  24. VIProductVersion "${VERSION}"
  25. VIAddVersionKey "ProductName" "The Onion Router: Tor"
  26. VIAddVersionKey "Comments" "http://tor.eff.org"
  27. VIAddVersionKey "LegalTrademarks" "Three line BSD"
  28. VIAddVersionKey "LegalCopyright" "©2004-2006, Roger Dingledine, Nick Mathewson"
  29. VIAddVersionKey "FileDescription" "Tor is an implementation of Onion Routing. You can read more at http://tor.eff.org/"
  30. VIAddVersionKey "FileVersion" "${VERSION}"
  31. ;Use upx on the installer header to shrink the size.
  32. !packhdr header.dat "upx --best header.dat"
  33. !define MUI_WELCOMEPAGE_TITLE "Welcome to the Tor ${VERSION} Setup Wizard"
  34. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Tor ${VERSION}.\r\n\r\nIf you have previously installed Tor and it is currently running, please exit Tor first before continuing this installation.\r\n\r\n$_CLICK"
  35. !define MUI_ABORTWARNING
  36. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
  37. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
  38. !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
  39. !define MUI_HEADERIMAGE
  40. !define MUI_FINISHPAGE_RUN "$INSTDIR\tor.exe"
  41. !define MUI_FINISHPAGE_LINK "Visit the Tor website for the latest updates."
  42. !define MUI_FINISHPAGE_LINK_LOCATION ${WEBSITE}
  43. !insertmacro MUI_PAGE_WELCOME
  44. ; There's no point in having a clickthrough license: Our license adds
  45. ; certain rights, but doesn't remove them.
  46. ; !insertmacro MUI_PAGE_LICENSE "${LICENSE}"
  47. !insertmacro MUI_PAGE_COMPONENTS
  48. !insertmacro MUI_PAGE_DIRECTORY
  49. !insertmacro MUI_PAGE_INSTFILES
  50. !insertmacro MUI_PAGE_FINISH
  51. !insertmacro MUI_UNPAGE_WELCOME
  52. !insertmacro MUI_UNPAGE_CONFIRM
  53. !insertmacro MUI_UNPAGE_INSTFILES
  54. !insertmacro MUI_UNPAGE_FINISH
  55. !insertmacro MUI_LANGUAGE "English"
  56. Var configdir
  57. Var configfile
  58. ;Sections
  59. ;--------
  60. Section "Tor" Tor
  61. ;Files that have to be installed for tor to run and that the user
  62. ;cannot choose not to install
  63. SectionIn RO
  64. SetOutPath $INSTDIR
  65. File "${BIN}\tor.exe"
  66. File "${BIN}\tor-resolve.exe"
  67. File "${BIN}\tor.ico"
  68. WriteIniStr "$INSTDIR\Tor Website.url" "InternetShortcut" "URL" ${WEBSITE}
  69. StrCpy $configfile "torrc"
  70. StrCpy $configdir $APPDATA\Tor
  71. ; ;If $APPDATA isn't valid here (Early win95 releases with no updated
  72. ; ; shfolder.dll) then we put it in the program directory instead.
  73. ; StrCmp $APPDATA "" "" +2
  74. ; StrCpy $configdir $INSTDIR
  75. SetOutPath $configdir
  76. ;If there's already a torrc config file, ask if they want to
  77. ;overwrite it with the new one.
  78. IfFileExists "$configdir\torrc" "" endiftorrc
  79. MessageBox MB_ICONQUESTION|MB_YESNO "You already have a Tor config file.$\r$\nDo you want to overwrite it with the default sample config file?" IDNO yesreplace
  80. Delete $configdir\torrc
  81. Goto endiftorrc
  82. yesreplace:
  83. StrCpy $configfile "torrc.sample"
  84. endiftorrc:
  85. File /oname=$configfile "..\src\config\torrc.sample"
  86. SectionEnd
  87. Section "OpenSSL 0.9.8c" OpenSSL
  88. SetOutPath $INSTDIR
  89. File "${BIN}\libcrypto.a"
  90. File "${BIN}\libssl.a"
  91. SectionEnd
  92. Section "Documents" Docs
  93. SetOutPath "$INSTDIR\Documents"
  94. ;File "doc\FAQ"
  95. File "..\doc\HACKING"
  96. File "..\doc\control-spec.txt"
  97. File "..\doc\dir-spec.txt"
  98. File "..\doc\rend-spec.txt"
  99. File "..\doc\socks-extensions.txt"
  100. File "..\doc\version-spec.txt"
  101. ;
  102. ; WEBSITE-FILES-HERE
  103. ;
  104. File "..\doc\tor-resolve.html"
  105. File "..\doc\tor-reference.html"
  106. ;
  107. File "..\doc\design-paper\tor-design.pdf"
  108. ;
  109. File "..\README"
  110. File "..\AUTHORS"
  111. File "..\ChangeLog"
  112. File "..\LICENSE"
  113. SectionEnd
  114. SubSection /e "Shortcuts" Shortcuts
  115. Section "Start Menu" StartMenu
  116. SetOutPath $INSTDIR
  117. IfFileExists "$SMPROGRAMS\Tor\*.*" "" +2
  118. RMDir /r "$SMPROGRAMS\Tor"
  119. CreateDirectory "$SMPROGRAMS\Tor"
  120. CreateShortCut "$SMPROGRAMS\Tor\Tor.lnk" "$INSTDIR\tor.exe" "" "$INSTDIR\tor.ico"
  121. CreateShortCut "$SMPROGRAMS\Tor\Torrc.lnk" "Notepad.exe" "$configdir\torrc"
  122. CreateShortCut "$SMPROGRAMS\Tor\Tor Website.lnk" "$INSTDIR\Tor Website.url"
  123. CreateShortCut "$SMPROGRAMS\Tor\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  124. IfFileExists "$INSTDIR\Documents\*.*" "" endifdocs
  125. CreateDirectory "$SMPROGRAMS\Tor\Documents"
  126. CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Manual.lnk" "$INSTDIR\Documents\tor-doc.html"
  127. CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Documentation.lnk" "$INSTDIR\Documents"
  128. CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Specification.lnk" "$INSTDIR\Documents\tor-spec.txt"
  129. endifdocs:
  130. SectionEnd
  131. Section "Desktop" Desktop
  132. SetOutPath $INSTDIR
  133. CreateShortCut "$DESKTOP\Tor.lnk" "$INSTDIR\tor.exe" "" "$INSTDIR\tor.ico"
  134. SectionEnd
  135. Section /o "Run at startup" Startup
  136. SetOutPath $INSTDIR
  137. CreateShortCut "$SMSTARTUP\Tor.lnk" "$INSTDIR\tor.exe" "" "$INSTDIR\tor.ico" "" SW_SHOWMINIMIZED
  138. SectionEnd
  139. SubSectionEnd
  140. Section "Uninstall"
  141. Delete "$DESKTOP\Tor.lnk"
  142. Delete "$INSTDIR\libcrypto.a"
  143. Delete "$INSTDIR\libssl.a"
  144. Delete "$INSTDIR\tor.exe"
  145. Delete "$INSTDIR\tor-resolve.exe"
  146. Delete "$INSTDIR\Tor Website.url"
  147. Delete "$INSTDIR\torrc"
  148. Delete "$INSTDIR\torrc.sample"
  149. Delete "$INSTDIR\tor.ico"
  150. StrCmp $configdir $INSTDIR +2 ""
  151. RMDir /r $configdir
  152. Delete "$INSTDIR\Uninstall.exe"
  153. RMDir /r "$INSTDIR\Documents"
  154. RMDir $INSTDIR
  155. RMDir /r "$SMPROGRAMS\Tor"
  156. RMDir /r "$APPDATA\Tor"
  157. Delete "$SMSTARTUP\Tor.lnk"
  158. DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tor"
  159. SectionEnd
  160. Section -End
  161. WriteUninstaller "$INSTDIR\Uninstall.exe"
  162. ;The registry entries simply add the Tor uninstaller to the Windows
  163. ;uninstall list.
  164. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tor" "DisplayName" "Tor (remove only)"
  165. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tor" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  166. SectionEnd
  167. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  168. !insertmacro MUI_DESCRIPTION_TEXT ${Tor} "The core executable and config files needed for Tor to run."
  169. !insertmacro MUI_DESCRIPTION_TEXT ${OpenSSL} "OpenSSL libraries required by Tor."
  170. !insertmacro MUI_DESCRIPTION_TEXT ${Docs} "Documentation about Tor."
  171. !insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Tor"
  172. !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Tor and it's documentation from the Start Menu"
  173. !insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Tor from the desktop"
  174. !insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Tor automatically at startup in a minimized window"
  175. !insertmacro MUI_FUNCTION_DESCRIPTION_END