[PATCH 4 of 4] Set automatically hg version in win32 installer
Pascal Quantin
pascal.quantin at gmail.com
Sun Apr 12 19:30:05 UTC 2009
# HG changeset patch
# User Pascal Quantin <pascal.quantin at gmail.com>
# Date 1232318797 -3600
# Node ID b161cb80b17ebda5e06c1557e8248ae0c3a8d499
# Parent 4d5e850d435c2e9d95ef92736a7c4c9078de666c
Set automatically hg version in win32 installer
When compiling hg, store version info in contrib/win32/version.txt and use it for installer.
The version info will appear in:
- installer name
- installer wizard
- windows explorer tooltip
- "Add or Remove" windows program
Note: now Inno Setup Preprocessor is needed to build the win32 installer. It is included
in the QuickStart Pack package downloadable from Inno Setup page.
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -16,6 +16,7 @@
tests/*.err
build
contrib/hgsh/hgsh
+contrib/win32/version.txt
dist
doc/*.[0-9]
doc/*.[0-9].gendoc.txt
diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
--- a/contrib/win32/mercurial.iss
+++ b/contrib/win32/mercurial.iss
@@ -1,9 +1,17 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define FileHandle
+#define Version = "unknown"
+#if FileHandle = FileOpen(SourcePath + "version.txt")
+ #define Version = FileRead(FileHandle)
+#endif
+#pragma message "Detected Version: " + Version
+
[Setup]
AppCopyright=Copyright 2005-2009 Matt Mackall and others
AppName=Mercurial
-AppVerName=Mercurial snapshot
+AppVerName=Mercurial {#Version}
InfoAfterFile=contrib/win32/postinstall.txt
LicenseFile=COPYING
ShowLanguageDialog=yes
@@ -13,10 +21,10 @@
AppUpdatesURL=http://www.selenic.com/mercurial
AppID={{4B95A5F1-EF59-4B08-BED8-C891C46121B3}
AppContact=mercurial at selenic.com
-OutputBaseFilename=Mercurial-snapshot
+OutputBaseFilename=Mercurial-{#Version}
DefaultDirName={pf}\Mercurial
SourceDir=..\..
-VersionInfoDescription=Mercurial distributed SCM
+VersionInfoDescription=Mercurial distributed SCM (version {#Version})
VersionInfoCopyright=Copyright 2005-2009 Matt Mackall and others
VersionInfoCompany=Matt Mackall and others
InternalCompressLevel=max
@@ -71,6 +79,7 @@
[UninstallDelete]
Type: files; Name: "{app}\hg.exe.local"
+
[Code]
var
WriteFile: Boolean;
diff --git a/contrib/win32/win32-build.txt b/contrib/win32/win32-build.txt
--- a/contrib/win32/win32-build.txt
+++ b/contrib/win32/win32-build.txt
@@ -21,7 +21,7 @@
The py2exe distutils extension
http://sourceforge.net/projects/py2exe/
- Inno Setup
+ Inno Setup and Inno Setup Preprocessor (bundled in QuickStart Pack)
http://www.jrsoftware.org/isinfo.php
ISTool - optional
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -133,6 +133,11 @@
except ImportError:
version = 'unknown'
+# Store version info for win32 installer
+f = file("contrib/win32/version.txt","w")
+f.write('%s' % version)
+f.close()
+
class install_package_data(install_data):
def finalize_options(self):
self.set_undefined_options('install',
More information about the Mercurial-devel
mailing list