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