tor-mingw.nsi.in 7.6 KB

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