CASA-auth-token-java Windows - change in Makefile to bump msi version number

This commit is contained in:
soochoi 2007-06-29 23:18:44 +00:00
parent 6bb01f7449
commit 964ffdea32
11 changed files with 598 additions and 0 deletions

View File

@ -45,6 +45,8 @@ devenv:
$(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@
echo [======== Updating msi numbers========]
"../../../tools/w32/VersionVDProj/bin/VersionVDProj.exe" -msi server-java_msi.vdproj version=$(VERSION)
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \
if eval $$CMD; then \

View File

@ -0,0 +1,105 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
//
// copyright 2003 Don Kackman - mailto:dkackman_2000@yahoo.com
//
// no warranty expressed or implied
// use however you'd like
//
using System;
namespace VersionVDProj
{
/// <summary>
/// This is the class that has the Main method. This class is responsible for parsing command line
/// arguments and dispatching them to the correct classes
/// </summary>
class App
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static int Main(string[] args)
{
if ( args.Length != 0 )
{
try
{
ArgumentParser arguments = new ArgumentParser( args );
VDProjectVersioner versioner = null;
switch ( arguments.Command )
{
case "msi":
versioner = new MSIProjectVersioner( arguments.ProjectFile );
break;
case "msm":
versioner = new MSMProjectVersioner( arguments.ProjectFile );
break;
default:
throw new Exception( string.Format( "Unrecognized command {0}", arguments.Command ) );
}
versioner.UpdateFile( arguments.Options );
return 0;
}
catch ( Exception e )
{
Console.WriteLine( "ERROR" );
Console.WriteLine( e.Message );
return 1;
}
}
// with no arguments show the usage
ShowUsage();
return 0;
}
private static void ShowUsage()
{
Console.WriteLine( "VersionVDProj -msi <PATH> version=<VERSION> [package=<PACKAGECODE>]" );
Console.WriteLine( "\t[product=<PRODUCTCODE>] [upgrade=<UPGRADECODE>]" );
Console.WriteLine( "The -msi switch is used for updating MSI installer projects" );
Console.WriteLine( "" );
Console.WriteLine( "<PATH> is the path to the vdproj file (without braces)" );
Console.WriteLine( "<VERSION> is the version to use in format #.#.# (without braces)" );
Console.WriteLine( "<PACKAGECODE> Optional package guid (if not specified will be auto-generated)" );
Console.WriteLine( "<PRODUCTCODE> Optional product guid (if not specified will be set to the" );
Console.WriteLine( "\tsame value used to set the package guid)" );
Console.WriteLine( "<UPGRADECODE> Optional upgrade guid (if not specified the upgrade code will" );
Console.WriteLine( "\tnot be modified)" );
Console.WriteLine( "" );
Console.WriteLine( "VersionVDProj -msm <PATH> version=<VERSION> [signature=<SIGNATURE>]" );
Console.WriteLine( "The -msm switch is used for updating merge module projects" );
Console.WriteLine( "" );
Console.WriteLine( "<PATH> is the path to the vdproj file (without braces)" );
Console.WriteLine( "<VERSION> is the version to use in format #.#.# (without braces)" );
Console.WriteLine( "<SIGNATURE> Optional unique id for the merge module (if not specified a guid" );
Console.WriteLine( "\tbased signature will be auto-generated)" );
Console.WriteLine( "" );
Console.WriteLine( "Named arguments can be specified in any order" );
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,82 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System;
using System.IO;
using System.Collections;
namespace VersionVDProj
{
/// <summary>
/// Summary description for ArgumentParser.
/// </summary>
public class ArgumentParser
{
public readonly Hashtable Options;
public readonly string Command;
public readonly FileInfo ProjectFile;
public ArgumentParser( string[] args )
{
Options = new Hashtable();
if ( args.Length < 2 )
throw new Exception( "Wrong number of arguments" );
Command = ParseCommand( args[0] );
ProjectFile = ParseFileName( args[1] );
for ( int i = 2; i < args.Length; i++ )
ParseArgument( args[i] );
}
private string ParseCommand( string command )
{
if ( command.Substring( 0, 1 ) != "-" )
throw new Exception( string.Format( "Unrecognized command {0}", command ) );
return command.Substring( 1 ).ToLower();
}
private FileInfo ParseFileName( string path )
{
FileInfo file = new FileInfo( path );
if ( !file.Exists )
throw new Exception( string.Format( "The file {0} could not be found", path ) );
return file;
}
private void ParseArgument( string arg )
{
int eqPos = arg.IndexOf( '=', 0 );
if ( eqPos == -1 )
throw new Exception( string.Format( "The argument {0} is not in the format NAME=VALUE", arg ) );
string name = arg.Substring( 0, eqPos );
string val = arg.Substring( eqPos + 1 );
Options.Add( name.ToLower(), val );
}
}
}

View File

@ -0,0 +1,86 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
//
// copyright 2003 Don Kackman - mailto:dkackman_2000@yahoo.com
//
// no warranty expressed or implied
// use however you'd like
//
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("Deployment Project Versioning Tool")]
[assembly: AssemblyDescription("Updates the version and guid of Visual Studio.Net deployment projects")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("2003 Don Kackman")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View File

@ -0,0 +1,93 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
//
// copyright 2003 Don Kackman - mailto:dkackman_2000@yahoo.com
//
// no warranty expressed or implied
// use however you'd like
//
using System;
using System.IO;
using System.Collections;
namespace VersionVDProj
{
/// <summary>
/// Class that updates the version info of MSI projects
/// </summary>
public class MSIProjectVersioner : VDProjectVersioner
{
private readonly static Guid MSI_PROJECT_TYPE = new Guid( "{978C614F-708E-4E1A-B201-565925725DBA}" );
private Guid productCode = Guid.Empty;
private Guid packageCode = Guid.Empty;
private Guid upgradeCode = Guid.Empty;
/// <summary>
/// createas a new instance of the class
/// </summary>
/// <param name="file">the project file</param>
public MSIProjectVersioner( FileInfo file ) : base( file, MSI_PROJECT_TYPE )
{
}
protected override void SetOptions( Hashtable options )
{
// get the package code - generate if not specified
if ( options.Contains("packagecode") )
packageCode = new Guid( options["packagecode"].ToString() );
else
packageCode = Guid.NewGuid();
// get the product code - set to package code if not specified
if ( options.Contains("productcode") )
productCode = new Guid( options["productcode"].ToString() );
else
productCode = packageCode;
// get the upgrade code - leave empty if not specified
if ( options.Contains("upgradecode") )
upgradeCode = new Guid( options["upgradecode"].ToString() );
}
protected override string TranslateLine( string line )
{
// look for the properties we are interested in changing
// if we find them, replace the old value with the new and return the new line string
// otherwise just return the line string
if ( line.IndexOf( "\"ProductVersion\"" ) != -1 )
line = ReplaceValue( line, "ProductVersion", version.ThreePartVersion );
else if ( productCode != Guid.Empty && line.IndexOf( "\"ProductCode\"" ) != -1 )
line = ReplaceValue( line, "ProductCode", "{" + productCode.ToString().ToUpper() + "}" );
else if ( packageCode != Guid.Empty && line.IndexOf( "\"PackageCode\"" ) != -1 )
line = ReplaceValue( line, "PackageCode", "{" + packageCode.ToString().ToUpper() + "}" );
else if ( upgradeCode != Guid.Empty && line.IndexOf( "\"UpgradeCode\"" ) != -1 )
line = ReplaceValue( line, "UpgradeCode", "{" + upgradeCode.ToString().ToUpper() + "}" );
return line;
}
}
}

View File

@ -0,0 +1,76 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
//
// copyright 2003 Don Kackman - mailto:dkackman_2000@yahoo.com
//
// no warranty expressed or implied
// use however you'd like
//
using System;
using System.IO;
using System.Collections;
namespace VersionVDProj
{
/// <summary>
/// Class that updates the version info of merge module projects
/// </summary>
public class MSMProjectVersioner : VDProjectVersioner
{
private readonly static Guid MSM_PROJECT_TYPE = new Guid( "{DD7A5B58-C2F9-40FF-B2EF-0773356FB978}" );
private string signature;
/// <summary>
/// createas a new instance of the class
/// </summary>
/// <param name="file">the project file</param>
public MSMProjectVersioner( FileInfo file ) : base( file, MSM_PROJECT_TYPE )
{
}
protected override void SetOptions( Hashtable options )
{
// get the signature - generate if not specified
if ( options.Contains( "signature" ) )
signature = options[signature].ToString();
else
signature = "MergeModule." + Guid.NewGuid().ToString().ToUpper().Replace( "-", "" );
}
protected override string TranslateLine( string line )
{
// look for the properties we are interested in changing
// if we find them, replace the old value with the new and return the new line string
// otherwise just return the line string
if ( line.IndexOf( "\"Version\"" ) != -1 )
line = ReplaceValue( line, "Version", version.FourPartVersion );
// module signature cannot have dashes
else if ( line.IndexOf( "\"ModuleSignature\"" ) != -1 )
line = ReplaceValue( line, "ModuleSignature", signature );
return line;
}
}
}

View File

@ -0,0 +1,21 @@
This is a command line utility that updates the version and GUID of VS.NET project files.
The source for this tool has been downloaded from the following site.
http://www.codeproject.com/dotnet/VersionVDProj.asp#xx1436860xx
The copy right associated with this tool is as followings:
////////////////////////////////////////////////////////////////
// copyright 2003 Don Kackman - mailto:dkackman_2000@yahoo.com
//
// no warranty expressed or implied
// use however you'd like
////////////////////////////////////////////////////////////////
4/14/2006
10/18/2006 change MSI_PROJECT_TYPE to work with VS 2006

View File

@ -0,0 +1,133 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{85DA1E26-3010-4CE8-A7F1-2ED180775C68}"
SccProjectName = "SAK"
SccLocalPath = "SAK"
SccAuxPath = "SAK"
SccProvider = "SAK"
>
<Build>
<Settings
ApplicationIcon = "App.ico"
AssemblyKeyContainerName = ""
AssemblyName = "VersionVDProj"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "VersionVDProj"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "App.ico"
BuildAction = "Content"
/>
<File
RelPath = "ArgumentParser.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MSIProjectVersioner.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MSMProjectVersioner.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "VDProjectVersioner.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Version.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>