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