diff --git a/src/Tools/WinVersion.py b/src/Tools/WinVersion.py new file mode 100644 index 000000000..48884686a --- /dev/null +++ b/src/Tools/WinVersion.py @@ -0,0 +1,49 @@ +#! python +# -*- coding: utf-8 -*- +# (c) 2012 Juergen Riegel LGPL +# +# Script to create files used in Windows build +# uses SubWCRev.py for version detection# + +import SubWCRev,getopt,sys,string + +def main(): + + input="" + output="." + dir="." + + try: + opts, args = getopt.getopt(sys.argv[1:], "dso:", ["dir=","src=","out="]) + except getopt.GetoptError: + pass + + for o, a in opts: + if o in ("-d", "--dir"): + dir = a + if o in ("-s", "--src"): + input = a + if o in ("-o", "--out"): + output = a + git = SubWCRev.GitControl() + + if(git.extractInfo(input)): + print git.hash + print git.branch + print git.rev[0:4] + print git.date + print git.url + print input + print output + + f = open(input,'r') + o = open(output,'w') + for line in f.readlines(): + line = string.replace(line,'$WCREV$',git.rev[0:4]) + line = string.replace(line,'$WCDATE$',git.date) + line = string.replace(line,'$WCURL$',git.url) + o.write(line) + + +if __name__ == "__main__": + main() diff --git a/src/WindowsInstaller/BuildInstaller.bat b/src/WindowsInstaller/BuildInstaller.bat index 384f476d6..d779137f6 100644 --- a/src/WindowsInstaller/BuildInstaller.bat +++ b/src/WindowsInstaller/BuildInstaller.bat @@ -4,9 +4,12 @@ if NOT DEFINED WIXDIR set WIXDIR=C:\Program Files (x86)\Windows Installer XML v3 rem in order to build an x64 installer set PLATFORM to x64 if not defined PLATFORM set PLATFORM=x86 -"C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. Version.wxi.in Version.wxi -"C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. CopyRelease.bat.in CopyRelease.bat -"C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. ..\Build\Version.h.in ..\Build\Version.h +C:\Python26\python.exe ../Tools/WinVersion.py --dir=../.. --src=Version.wxi.in --out=Version.wxi +C:\Python26\python.exe ../Tools/WinVersion.py --dir=../.. --src=CopyRelease.bat.in --out=CopyRelease.bat +C:\Python26\python.exe ../Tools/WinVersion.py --dir=../.. --src=../Build/Version.h.in --out=../Build/Version.h +rem "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. Version.wxi.in Version.wxi +rem "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. CopyRelease.bat.in CopyRelease.bat +rem "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" ..\.. ..\Build\Version.h.in ..\Build\Version.h SET /P M=Reebuild and press enter diff --git a/src/WindowsInstaller/CopyRelease.bat.in b/src/WindowsInstaller/CopyRelease.bat.in index 0c21c8b68..10b1758f6 100644 --- a/src/WindowsInstaller/CopyRelease.bat.in +++ b/src/WindowsInstaller/CopyRelease.bat.in @@ -1,4 +1,4 @@ -copy FreeCAD.msi FreeCAD_0.12.$WCREV$_x86_unstable_setup.msi -copy FreeCAD.7z FreeCAD_0.12.$WCREV$_x86_unstable_bin.7z \ No newline at end of file +copy FreeCAD.msi FreeCAD_0.13.$WCREV$_x86_unstable_setup.msi +copy FreeCAD.7z FreeCAD_0.13.$WCREV$_x86_unstable_bin.7z \ No newline at end of file diff --git a/src/WindowsInstaller/FreeCAD.wxs b/src/WindowsInstaller/FreeCAD.wxs index c6ebcc680..a9c15ed40 100644 --- a/src/WindowsInstaller/FreeCAD.wxs +++ b/src/WindowsInstaller/FreeCAD.wxs @@ -27,9 +27,9 @@ - + - + diff --git a/src/WindowsInstaller/Version.wxi.in b/src/WindowsInstaller/Version.wxi.in index 94688a589..9d49f2aaa 100644 --- a/src/WindowsInstaller/Version.wxi.in +++ b/src/WindowsInstaller/Version.wxi.in @@ -1,5 +1,5 @@ - +