~ubuntu-branches/ubuntu/edgy/tor/edgy

« back to all changes in this revision

Viewing changes to contrib/tor.nsi

  • Committer: Bazaar Package Importer
  • Author(s): Peter Palfrader
  • Date: 2006-07-06 02:55:37 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060706025537-77irayomswemsl63
Tags: 0.1.1.22-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
;tor.nsi - A basic win32 installer for Tor
2
 
; Originally written by J Doe.
3
 
; See LICENSE for licencing information
4
 
;-----------------------------------------
5
 
;
6
 
; How to make an installer:
7
 
;   Step 0. If you are a Tor maintainer, make sure that tor.nsi and
8
 
;           src/win32/orconfig.h all have the correct version number.
9
 
;   Step 1. Download and install OpenSSL.  Make sure that the OpenSSL
10
 
;           version listed below matches the one you downloaded.
11
 
;   Step 2. Download and install NSIS (http://nsis.sourceforge.net)
12
 
;   Step 3. Make a directory under the main tor directory called "bin".
13
 
;   Step 4. Copy ssleay32.dll and libeay32.dll from OpenSSL into "bin".
14
 
;   Step 5. Run man2html on tor.1.in; call the result tor-reference.html
15
 
;           Run man2html on tor-resolve.1; call the result tor-resolve.html
16
 
;   Step 6. Copy torrc.sample.in to torrc.sample.
17
 
;   Step 7. Build tor.exe and tor_resolve.exe; save the result into bin.
18
 
;   Step 8. cd into contrib and run "makensis tor.nsi".
19
 
;
20
 
; Problems:
21
 
;   - Copying torrc.sample.in to torrc.sample and tor.1.in (implicitly)
22
 
;     to tor.1 is a Bad Thing, and leaves us with @autoconf@ vars in the final
23
 
;     result.
24
 
;   - Building Tor requires too much windows C clue.
25
 
;     - We should have actual makefiles for VC that do the right thing.
26
 
;   - I need to learn more NSIS juju to solve these:
27
 
;     - There should be a batteries-included installer that comes with
28
 
;       privoxy too. (Check privoxy license on this; be sure to include
29
 
;       all privoxy documents.)
30
 
;   - The filename should probably have a revision number.
31
 
 
32
 
!include "MUI.nsh"
33
 
 
34
 
!define VERSION "0.1.0.16"
35
 
!define INSTALLER "tor-${VERSION}-win32.exe"
36
 
!define WEBSITE "http://tor.eff.org/"
37
 
 
38
 
!define LICENSE "..\LICENSE"
39
 
;BIN is where it expects to find tor.exe, tor_resolve.exe, libeay32.dll and
40
 
;  ssleay32.dll
41
 
!define BIN "..\bin"
42
 
 
43
 
SetCompressor lzma
44
 
;SetCompressor zlib
45
 
OutFile ${INSTALLER}
46
 
InstallDir $PROGRAMFILES\Tor
47
 
SetOverWrite ifnewer
48
 
 
49
 
Name "Tor"
50
 
Caption "Tor ${VERSION} Setup"
51
 
BrandingText "The Onion Router"
52
 
CRCCheck on
53
 
 
54
 
;Use upx on the installer header to shrink the size.
55
 
!packhdr header.dat "upx --best header.dat"
56
 
 
57
 
!define MUI_WELCOMEPAGE_TITLE "Welcome to the Tor ${VERSION} Setup Wizard"
58
 
!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"
59
 
!define MUI_ABORTWARNING
60
 
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
61
 
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
62
 
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
63
 
!define MUI_HEADERIMAGE
64
 
!define MUI_FINISHPAGE_RUN "$INSTDIR\tor.exe"
65
 
!define MUI_FINISHPAGE_LINK "Visit the Tor website for the latest updates."
66
 
!define MUI_FINISHPAGE_LINK_LOCATION ${WEBSITE}
67
 
 
68
 
!insertmacro MUI_PAGE_WELCOME
69
 
; There's no point in having a clickthrough license: Our license adds
70
 
; certain rights, but doesn't remove them.
71
 
; !insertmacro MUI_PAGE_LICENSE "${LICENSE}"
72
 
!insertmacro MUI_PAGE_COMPONENTS
73
 
!insertmacro MUI_PAGE_DIRECTORY
74
 
!insertmacro MUI_PAGE_INSTFILES
75
 
!insertmacro MUI_PAGE_FINISH
76
 
!insertmacro MUI_UNPAGE_WELCOME
77
 
!insertmacro MUI_UNPAGE_CONFIRM
78
 
!insertmacro MUI_UNPAGE_INSTFILES
79
 
!insertmacro MUI_UNPAGE_FINISH
80
 
!insertmacro MUI_LANGUAGE "English"
81
 
 
82
 
Var configdir
83
 
Var configfile
84
 
 
85
 
;Sections
86
 
;--------
87
 
 
88
 
Section "Tor" Tor
89
 
;Files that have to be installed for tor to run and that the user
90
 
;cannot choose not to install
91
 
   SectionIn RO
92
 
   SetOutPath $INSTDIR
93
 
   File "${BIN}\tor.exe"
94
 
   File "${BIN}\tor_resolve.exe"
95
 
   WriteIniStr "$INSTDIR\Tor Website.url" "InternetShortcut" "URL" ${WEBSITE}
96
 
 
97
 
   StrCpy $configfile "torrc"
98
 
   StrCpy $configdir $APPDATA\Tor
99
 
;   ;If $APPDATA isn't valid here (Early win95 releases with no updated
100
 
;   ; shfolder.dll) then we put it in the program directory instead.
101
 
;   StrCmp $APPDATA "" "" +2
102
 
;      StrCpy $configdir $INSTDIR
103
 
   SetOutPath $configdir
104
 
   ;If there's already a torrc config file, ask if they want to
105
 
   ;overwrite it with the new one.
106
 
   IfFileExists "$configdir\torrc" "" +5
107
 
      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 +3
108
 
      Delete $configdir\torrc
109
 
      Goto +2
110
 
         StrCpy $configfile "torrc.sample"
111
 
   File /oname=$configfile "..\src\config\torrc.sample"
112
 
SectionEnd
113
 
 
114
 
Section "OpenSSL 0.9.7e" OpenSSL
115
 
   SetOutPath $INSTDIR
116
 
   File "${BIN}\libeay32.dll"
117
 
   File "${BIN}\ssleay32.dll"
118
 
SectionEnd
119
 
 
120
 
Section "Documents" Docs
121
 
   SetOutPath "$INSTDIR\Documents"
122
 
   File "..\doc\CLIENTS"
123
 
   File "..\doc\tor-spec.txt"
124
 
   #File "..\doc\FAQ"
125
 
   File "..\doc\HACKING"
126
 
   File "..\doc\rend-spec.txt"
127
 
   File "..\doc\control-spec.txt"
128
 
   File "..\doc\tor-doc.html"
129
 
   File "..\doc\tor-doc.css"
130
 
   File "..\doc\tor-resolve.html"
131
 
   File "..\doc\tor-reference.html"
132
 
   File "..\doc\design-paper\tor-design.pdf"
133
 
   File "..\README"
134
 
   File "..\AUTHORS"
135
 
   File "..\ChangeLog"
136
 
   File "..\LICENSE"
137
 
SectionEnd
138
 
 
139
 
SubSection /e "Shortcuts" Shortcuts
140
 
 
141
 
Section "Start Menu" StartMenu
142
 
   SetOutPath $INSTDIR
143
 
   IfFileExists "$SMPROGRAMS\Tor\*.*" "" +2
144
 
      RMDir /r "$SMPROGRAMS\Tor"
145
 
   CreateDirectory "$SMPROGRAMS\Tor"
146
 
   CreateShortCut "$SMPROGRAMS\Tor\Tor.lnk" "$INSTDIR\tor.exe"
147
 
   CreateShortCut "$SMPROGRAMS\Tor\Torrc.lnk" "Notepad.exe" "$configdir\torrc"
148
 
   CreateShortCut "$SMPROGRAMS\Tor\Tor Website.lnk" "$INSTDIR\Tor Website.url"
149
 
   CreateShortCut "$SMPROGRAMS\Tor\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
150
 
   IfFileExists "$INSTDIR\Documents\*.*" "" +5
151
 
      CreateDirectory "$SMPROGRAMS\Tor\Documents"
152
 
      CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Manual.lnk" "$INSTDIR\Documents\tor-doc.html"
153
 
      CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Documentation.lnk" "$INSTDIR\Documents"
154
 
      CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Specification.lnk" "$INSTDIR\Documents\tor-spec.txt"
155
 
SectionEnd
156
 
 
157
 
Section "Desktop" Desktop
158
 
   SetOutPath $INSTDIR
159
 
   CreateShortCut "$DESKTOP\Tor.lnk" "$INSTDIR\tor.exe"
160
 
SectionEnd
161
 
 
162
 
Section /o "Run at startup" Startup
163
 
   SetOutPath $INSTDIR
164
 
   CreateShortCut "$SMSTARTUP\Tor.lnk" "$INSTDIR\tor.exe" "" "" 0 SW_SHOWMINIMIZED
165
 
SectionEnd
166
 
 
167
 
SubSectionEnd
168
 
 
169
 
Section "Uninstall"
170
 
   Delete "$DESKTOP\Tor.lnk"
171
 
   Delete "$INSTDIR\libeay32.dll"
172
 
   Delete "$INSTDIR\ssleay32.dll"
173
 
   Delete "$INSTDIR\tor.exe"
174
 
   Delete "$INSTDIR\tor_resolve.exe"
175
 
   Delete "$INSTDIR\Tor Website.url"
176
 
   Delete "$INSTDIR\torrc"
177
 
   Delete "$INSTDIR\torrc.sample"
178
 
   StrCmp $configdir $INSTDIR +2 ""
179
 
      RMDir /r $configdir
180
 
   Delete "$INSTDIR\Uninstall.exe"
181
 
   RMDir /r "$INSTDIR\Documents"
182
 
   RMDir $INSTDIR
183
 
   RMDir /r "$SMPROGRAMS\Tor"
184
 
   Delete "$SMSTARTUP\Tor.lnk"
185
 
   DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Tor"
186
 
SectionEnd
187
 
 
188
 
Section -End
189
 
    WriteUninstaller "$INSTDIR\Uninstall.exe"
190
 
    ;The registry entries simply add the Tor uninstaller to the Windows
191
 
    ;uninstall list.
192
 
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tor" "DisplayName" "Tor (remove only)"
193
 
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tor" "UninstallString" '"$INSTDIR\Uninstall.exe"'
194
 
SectionEnd
195
 
 
196
 
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
197
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Tor} "The core executable and config files needed for Tor to run."
198
 
  !insertmacro MUI_DESCRIPTION_TEXT ${OpenSSL} "OpenSSL libraries required by Tor."
199
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Docs} "Documentation about Tor."
200
 
  !insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Tor"
201
 
  !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Tor and it's documentation from the Start Menu"
202
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Tor from the desktop"
203
 
  !insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Tor automatically at startup in a minimized window"
204
 
!insertmacro MUI_FUNCTION_DESCRIPTION_END
205