Installer for svnmerge

Here's how to build svnmerge as a Windows binary and then create an installer for it.

Required Software

Subversion Python bindings for Python 2.5 are not currently available.

You will need the following installed on your machine (as of Subversion 1.4.3 and done on 1 February 2007):

You will also need to download svnmerge.py from the Subversion repository. I fetched the version at r25684.

First you have to create the binaries using py2exe. This isn't difficult, you create a file called setup.py which looks like this:

from distutils.core import setup
import py2exe

setup(console=['svnmerge.py'])

Then run the following command from a command prompt:

python setup.py py2exe

This will create a folder called dist which will have the binaries in it.

The Installer

I put the files I needed into c:\svnmerge and used this InnoSetup script to create the installer:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=svnmerge
AppVerName=svnmerge r23305
AppPublisher=Martin Tomes
AppPublisherURL=http://www.subversionary.org/
AppSupportURL=http://www.subversionary.org/
AppUpdatesURL=http://www.subversionary.org/
DefaultDirName={pf}\svnmerge
DefaultGroupName=svnmerge
DisableProgramGroupPage=yes
LicenseFile=C:\svnmerge\gpl.txt
OutputDir=C:\svnmerge\installer
OutputBaseFilename=svnmerge-setup
Compression=lzma
SolidCompression=yes
SetupIconFile=subversion_logo.ico

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Files]
Source: C:\svnmerge\dist\svnmerge.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\_ctypes.pyd; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\bz2.pyd; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\library.zip; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\MSVCR71.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\python24.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\unicodedata.pyd; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\w9xpopen.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\svnmerge\dist\zlib.pyd; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: SetEnv.exe; DestDir: {app}; Flags: ignoreversion
Source: subversion_logo.ico; DestDir: {app}; Flags: ignoreversion

[Icons]

[Run]
Filename: {app}\SetEnv.exe; Parameters: "-a PATH %""{app}"""; Flags: runminimized
[UninstallRun]
Filename: {app}\SetEnv.exe; Parameters: "-d PATH %""{app}"""; Flags: runminimized

Create the .iss file, open it with ISTool and make the installer file.

The final installer and the two source files are attached to this page.

AttachmentSize
setup.py.txt83 bytes
svnmerge.iss1.73 KB
svnmerge-setup.exe1.45 MB
Tue, 2006-10-03 12:21
( categories: )