##// END OF EJS Templates
iss: take version from iscc command line or __version__.py...
Steve Borho -
r9356:9488a4d6 default
parent child Browse files
Show More
@@ -1,103 +1,119 b''
1 1 ; Script generated by the Inno Setup Script Wizard.
2 2 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3
4 #ifndef VERSION
5 #define FileHandle
6 #define FileLine
7 #define VERSION = "unknown"
8 #if FileHandle = FileOpen(SourcePath + "\..\..\mercurial\__version__.py")
9 #expr FileLine = FileRead(FileHandle)
10 #expr FileLine = FileRead(FileHandle)
11 #define VERSION = Copy(FileLine, Pos('"', FileLine)+1, Len(FileLine)-Pos('"', FileLine)-1)
12 #endif
13 #if FileHandle
14 #expr FileClose(FileHandle)
15 #endif
16 #pragma message "Detected Version: " + VERSION
17 #endif
18
3 19 [Setup]
4 20 AppCopyright=Copyright 2005-2009 Matt Mackall and others
5 21 AppName=Mercurial
6 AppVerName=Mercurial snapshot
22 AppVerName=Mercurial {#VERSION}
7 23 InfoAfterFile=contrib/win32/postinstall.txt
8 24 LicenseFile=COPYING
9 25 ShowLanguageDialog=yes
10 26 AppPublisher=Matt Mackall and others
11 27 AppPublisherURL=http://mercurial.selenic.com/
12 28 AppSupportURL=http://mercurial.selenic.com/
13 29 AppUpdatesURL=http://mercurial.selenic.com/
14 30 AppID={{4B95A5F1-EF59-4B08-BED8-C891C46121B3}
15 31 AppContact=mercurial@selenic.com
16 OutputBaseFilename=Mercurial-snapshot
32 OutputBaseFilename=Mercurial-{#VERSION}
17 33 DefaultDirName={pf}\Mercurial
18 34 SourceDir=..\..
19 VersionInfoDescription=Mercurial distributed SCM
35 VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
20 36 VersionInfoCopyright=Copyright 2005-2009 Matt Mackall and others
21 37 VersionInfoCompany=Matt Mackall and others
22 38 InternalCompressLevel=max
23 39 SolidCompression=true
24 40 SetupIconFile=contrib\win32\mercurial.ico
25 41 AllowNoIcons=true
26 42 DefaultGroupName=Mercurial
27 43 PrivilegesRequired=none
28 44
29 45 [Files]
30 46 Source: contrib\mercurial.el; DestDir: {app}/Contrib
31 47 Source: contrib\vim\*.*; DestDir: {app}/Contrib/Vim
32 48 Source: contrib\zsh_completion; DestDir: {app}/Contrib
33 49 Source: contrib\hgk; DestDir: {app}/Contrib; DestName: hgk.tcl
34 50 Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme
35 51 Source: contrib\mergetools.hgrc; DestDir: {tmp};
36 52 Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
37 53 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt
38 54 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
39 55 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
40 56 Source: dist\library.zip; DestDir: {app}
41 57 Source: dist\mfc*.dll; DestDir: {app}
42 58 Source: dist\msvc*.dll; DestDir: {app}
43 59 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
44 60 Source: dist\Microsoft.VC*.MFC.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
45 61 Source: dist\w9xpopen.exe; DestDir: {app}
46 62 Source: dist\add_path.exe; DestDir: {app}
47 63 Source: doc\*.html; DestDir: {app}\Docs
48 64 Source: locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs
49 65 Source: templates\*.*; DestDir: {app}\Templates; Flags: recursesubdirs createallsubdirs
50 66 Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt
51 67 Source: COPYING; DestDir: {app}; DestName: Copying.txt
52 68
53 69 [INI]
54 70 Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: http://mercurial.selenic.com/
55 71
56 72 [UninstallDelete]
57 73 Type: files; Name: {app}\Mercurial.url
58 74
59 75 [Icons]
60 76 Name: {group}\Uninstall Mercurial; Filename: {uninstallexe}
61 77 Name: {group}\Mercurial Command Reference; Filename: {app}\Docs\hg.1.html
62 78 Name: {group}\Mercurial Configuration Files; Filename: {app}\Docs\hgrc.5.html
63 79 Name: {group}\Mercurial Ignore Files; Filename: {app}\Docs\hgignore.5.html
64 80 Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url
65 81
66 82 [Run]
67 83 Filename: "{app}\add_path.exe"; Parameters: "{app}"; Flags: postinstall; Description: "Add the installation path to the search path"
68 84
69 85 [UninstallRun]
70 86 Filename: "{app}\add_path.exe"; Parameters: "/del {app}"
71 87
72 88 [UninstallDelete]
73 89 Type: files; Name: "{app}\hg.exe.local"
74 90 [Code]
75 91 var
76 92 WriteFile: Boolean;
77 93 CheckDone: Boolean;
78 94
79 95 function CheckFile(): Boolean;
80 96 begin
81 97 if not CheckDone then begin
82 98 WriteFile := True;
83 99 if FileExists(ExpandConstant(CurrentFileName)) then begin
84 100 WriteFile := MsgBox('' + ExpandConstant(CurrentFileName) + '' #13#13 'The file already exists.' #13#13 'Would you like Setup to overwrite it?', mbConfirmation, MB_YESNO) = idYes;
85 101 end;
86 102 CheckDone := True;
87 103 end;
88 104 Result := WriteFile;
89 105 end;
90 106
91 107 procedure ConcatenateFiles();
92 108 var
93 109 MergeConfigs: TArrayOfString;
94 110 begin
95 111 if LoadStringsFromFile(ExpandConstant('{tmp}\mergetools.hgrc'),MergeConfigs) then begin
96 112 SaveStringsToFile(ExpandConstant(CurrentFileName),MergeConfigs,True);
97 113 end;
98 114 end;
99 115
100 116 procedure Touch(fn: String);
101 117 begin
102 118 SaveStringToFile(ExpandConstant(fn), '', False);
103 119 end;
@@ -1,109 +1,115 b''
1 1 The standalone Windows installer for Mercurial is built in a somewhat
2 2 jury-rigged fashion.
3 3
4 4 It has the following prerequisites, at least as I build it:
5 5
6 6 Python for Windows
7 7 http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
8 8
9 9 MinGW
10 10 http://www.mingw.org/
11 11
12 12 Python for Windows Extensions
13 13 http://sourceforge.net/projects/pywin32/
14 14
15 15 mfc71.dll (just download, don't install; not needed for Python 2.6)
16 16 http://starship.python.net/crew/mhammond/win32/
17 17
18 18 Visual C++ 2008 redistributable package (needed for Python 2.6)
19 19 http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
20 20
21 21 The py2exe distutils extension
22 22 http://sourceforge.net/projects/py2exe/
23 23
24 24 GnuWin32 gettext utility
25 25 http://gnuwin32.sourceforge.net/packages/gettext.htm
26 26
27 27 Inno Setup
28 http://www.jrsoftware.org/isinfo.php
28 http://www.jrsoftware.org/isdl.php#qsp
29
30 Get and install ispack-5.3.4.exe which includes Inno Setup Processor,
31 which is necessary to package Mercurial.
29 32
30 33 ISTool - optional
31 34 http://www.istool.org/default.aspx/
32 35
33 36 add_path (you need only add_path.exe in the zip file)
34 37 http://www.barisione.org/apps.html#add_path
35 38
36 39 Asciidoc - optional
37 40 http://www.methods.co.nz/asciidoc/
38 41
39 42 And, of course, Mercurial itself.
40 43
41 44 Once you have all this installed and built, clone a copy of the
42 45 Mercurial repository you want to package, and name the repo
43 46 C:\hg\hg-release.
44 47
45 48 In a shell, build a standalone copy of the hg.exe program:
46 49
47 50 python setup.py build -c mingw32
48 51 python setup.py py2exe -b 1
49 52
50 53 Note: the previously suggested combined command of "python setup.py build -c
51 54 mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the
52 55 extensions in the mercurial subdirectory.
53 56
54 57 If you want to create a file named setup.cfg with the contents:
55 58
56 59 [build]
57 60 compiler=mingw32
58 61
59 62 you can skip the first build step.
60 63
61 64 Copy add_path.exe into the dist directory that just got created.
62 65
63 66 If you are using Python up to version 2.5.4, copy mfc71.dll into the dist
64 67 directory that just got created.
65 68
66 69 If you are using Python 2.6 or later, after installing the Visual C++ 2008
67 70 redistributable package copy into the dist directory that just got created the
68 71 following files:
69 72 - from the directory starting with
70 73 Windows/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
71 74 the files named: msvcm90.dll, msvcp90.dll and msvcr90.dll
72 75 - from the directory starting with
73 76 Windows/WinSxS/x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8
74 77 the files named: mfc90.dll, mfc90u.dll, mfcm90.dll and mfcm90u.dll
75 78 - from the directory named Windows/WinSxS/Manifests, the manifest file
76 79 starting with x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
77 80 (rename it to Microsoft.VC90.CRT.manifest) and the manifest file starting
78 81 with x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8 (rename it to
79 82 Microsoft.VC90.MFC.manifest)
80 83
81 84 Before building the installer, you have to build Mercurial HTML documentation
82 85 (or fix mercurial.iss to not reference the doc directory). Assuming you have an
83 86 "asciidoc.bat" batch file somewhere in your PATH:
84 87
85 88 cd doc
86 89 mingw32-make ASCIIDOC=asciidoc.bat html
87 90 cd ..
88 91
89 92 If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
90 93 file and type Ctrl-F9 to compile the installer file.
91 94
92 Otherwise you run the Inno Setup compiler. Assuming it's on the path you run:
95 Otherwise you run the Inno Setup compiler. Assuming it's in the path
96 you should execute:
93 97
94 iscc contrib\win32\mercurial.iss
98 iscc contrib\win32\mercurial.iss /DVERSION=foo
95 99
96 The actual installer will be in the C:\hg\hg-release\Output directory.
100 Where 'foo' is the version number you would like to see in the
101 'Add/Remove Applications' tool. The installer will be placed into
102 a directory named Output/ at the root of your repository.
97 103
98 104 To automate the steps above you may want to create a batchfile based on the
99 105 following:
100 106
101 107 echo [build] > setup.cfg
102 108 echo compiler=mingw32 >> setup.cfg
103 109 python setup.py py2exe -b 1
104 110 cd doc
105 111 mingw32-make ASCIIDOC=asciidoc.bat html
106 112 cd ..
107 iscc contrib\win32\mercurial.iss
113 iscc contrib\win32\mercurial.iss /DVERSION=snapshot
108 114
109 115 and run it from the root of the hg repository (c:\hg\hg-release).
General Comments 0
You need to be logged in to leave comments. Login now