1 ; Copyright (C) 2008, Vincent Povirk for CodeWeavers
3 ; This library is free software; you can redistribute it and/or
4 ; modify it under the terms of the GNU Lesser General Public
5 ; License as published by the Free Software Foundation; either
6 ; version 2 of the License, or (at your option) any later version.
8 ; This library is distributed in the hope that it will be useful,
9 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ; Lesser General Public License for more details.
13 ; You should have received a copy of the GNU Lesser General Public
14 ; License along with this library; if not, write to the
15 ; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 ; Boston, MA 02111-1307, USA.
18 ; Compiled to setup.exe using AutoHotKey's script compiler (www.autohotkey.com)
23 DownloadWithProgressBar
(url
, desc
, size
, file
)
25 global DownloadProgress
= 0
27 ProgressWidth
:= A_ScreenWidth
/ 3
29 ;TODO: internationalize this text
30 Gui, Add
, Text
, , Downloading
%desc%...
31 Gui, Add
, Progress, Range
-0-%size% VDownloadProgress w
%ProgressWidth%
32 Gui, Add
, Button
, Right GQuit
, Cancel
35 SetTimer, UpdateDownloadProgress
, 500
37 UrlDownloadToFile, %url%, %file%
41 SetTimer, UpdateDownloadProgress
, Off
47 UpdateDownloadProgress
:
48 FileGetSize, BytesDownloaded
, %file%
49 GuiControl,, DownloadProgress
, %BytesDownloaded%
54 ; UrlDownloadToFile can't be interrupted once it started so we have to end
59 UpdateFirefoxShortcut
()
61 RegRead, CurrentVersion
, HKEY_LOCAL_MACHINE
, Software
\Mozilla
\Mozilla Firefox
, CurrentVersion
62 IfEqual
, ErrorLevel
, 1
63 FileCreateShortcut, %A_ScriptDir%\setup
.exe setup
-firefox
, %A_ProgramsCommon%\Install Firefox
.lnk
65 FileDelete, %A_ProgramsCommon%\Install Firefox
.lnk
68 ; The thing on the left in IfEqual is a variable name. This compares the first
69 ; argument to setup-firefox
70 IfEqual
, 1, setup
-firefox
72 filename
= %A_Temp%\install
-firefox
.exe
74 ; TODO: check firefox install
75 DownloadWithProgressBar
("http://download.mozilla.org/?product=firefox-3.0.5&os=win&lang=en-US", "firefox", 7518240, filename
)
77 IfEqual
, ErrorLevel
, 1
82 UpdateFirefoxShortcut
()
86 ;normal pre-init setup
88 RegWrite, REG_SZ
, HKEY_CURRENT_USER
, Software
\Wine
\WineBrowser
, Browser
, sugar
-start
-uri
90 ;don't ever blink cursors
91 IniWrite, -1, %A_WinDir%\win
.ini
, windows
, CursorBlinkRate
93 ; work around wine bug 16729
94 RegWrite, REG_SZ
, HKEY_CURRENT_USER
, Control Panel
\Desktop
, FontSmoothing
, 2
95 RegWrite, REG_DWORD
, HKEY_CURRENT_USER
, Control Panel
\Desktop
, FontSmoothingType
, 1
96 RegWrite, REG_DWORD
, HKEY_CURRENT_USER
, Control Panel
\Desktop
, FontSmoothingGamma
, 1400
98 FileCreateShortcut, %A_ScriptDir%\7zip
\7zFM
.exe C
:, %A_ProgramsCommon%\Accessories
\7-Zip File Manager
.lnk
, %A_ScriptDir%\7zip
100 ; 7zip file associations
101 archive_types
= 7z rar z zip
102 Loop, Parse
, archive_types
, %A_Space%
104 RegWrite, REG_SZ
, HKEY_CLASSES_ROOT
, .%A_LoopField%, , 7-Zip
.%A_LoopField%
105 RegWrite, REG_SZ
, HKEY_CLASSES_ROOT
, 7-Zip
.%A_LoopField%, , %A_LoopField% Archive
106 RegWrite, REG_SZ
, HKEY_CLASSES_ROOT
, 7-Zip
.%A_LoopField%\DefaultIcon
, , %A_ScriptDir%\7zip
\7z
.dll
`,0
107 RegWrite, REG_SZ
, HKEY_CLASSES_ROOT
, 7-Zip
.%A_LoopField%\shell
\open
\command
, , "%A_ScriptDir%\7zip\7zFM.exe" "`%1"
110 UpdateFirefoxShortcut
()