10 changed files with 84 additions and 399 deletions
@ -1,6 +0,0 @@ |
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||||
<PropertyGroup> |
|
||||||
<SetupProductBuildVersion>1</SetupProductBuildVersion> |
|
||||||
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants> |
|
||||||
</PropertyGroup> |
|
||||||
</Project> |
|
||||||
@ -1,6 +1,6 @@ |
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
<PropertyGroup> |
<PropertyGroup> |
||||||
<SetupProductBuildVersion>$INSERTPRODUCTBUILDVERSION$</SetupProductBuildVersion> |
<SetupProductBuildVersion>$INSERTREVISION$</SetupProductBuildVersion> |
||||||
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants> |
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants> |
||||||
</PropertyGroup> |
</PropertyGroup> |
||||||
</Project> |
</Project> |
||||||
@ -1,4 +1,4 @@ |
|||||||
del "bin\SharpDevelop.msi" |
del "bin\SharpDevelop.msi" |
||||||
"..\Tools\UpdateSetupInfo\bin\UpdateSetupInfo.exe" |
"..\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" |
||||||
%windir%\microsoft.net\framework\v2.0.50727\msbuild SharpDevelop.Setup.sln "/p:SharpDevelopBinPath=%CD%\..\..\bin" |
%windir%\microsoft.net\framework\v2.0.50727\msbuild SharpDevelop.Setup.sln "/p:SharpDevelopBinPath=%CD%\..\..\bin" |
||||||
@IF %ERRORLEVEL% NEQ 0 PAUSE |
@IF %ERRORLEVEL% NEQ 0 PAUSE |
||||||
@ -1 +1,35 @@ |
|||||||
Read doc/technotes/Versioning.html |
Assembly versioning: Please read doc/technotes/Versioning.html |
||||||
|
|
||||||
|
|
||||||
|
Updates the SharpDevelop Setup information |
||||||
|
------------------------------------------ |
||||||
|
|
||||||
|
Product Revision (Subversion revision number) |
||||||
|
|
||||||
|
With WiX 3 the package code and product code guids do not need to be generated by |
||||||
|
this tool and can be autogenerated by WiX. |
||||||
|
|
||||||
|
The build server and the buildSetup.bat executes the UpdateSetupInfo tool before |
||||||
|
building SharpDevelop.Setup.sln. The SharpDevelop.Setup project does not use the tool. |
||||||
|
|
||||||
|
Operation |
||||||
|
--------- |
||||||
|
|
||||||
|
1) The SharpDevelop.Setup.wixproj.user is is generated each time the tool is run |
||||||
|
based on the SharpDevelop.Setup.wixproj.user.template file. The product revision is inserted |
||||||
|
into the newly generated file. |
||||||
|
|
||||||
|
2) The build server and buildSetup.bat will run the UpdateSetupInfo tool. |
||||||
|
This is not done by the SharpDevelop.Setup project itself intentionally so |
||||||
|
nothing changes when building the project from inside SharpDevelop. The |
||||||
|
modified SharpDevelop.Setup.wixproj.user need not be checked into the |
||||||
|
repository on each build on the build server. |
||||||
|
|
||||||
|
Creating Releases |
||||||
|
----------------- |
||||||
|
|
||||||
|
When creating a release either the setup msi from the build server should be |
||||||
|
used or that generated after running buildSetup.bat. This will revision number |
||||||
|
if the current revision has changed. |
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,232 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Globalization; |
|
||||||
using System.IO; |
|
||||||
using System.Text; |
|
||||||
|
|
||||||
using SharpSvn; |
|
||||||
|
|
||||||
namespace UpdateSetupInfo |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Creates the SharpDevelop.Setup.wixproj.user file based on the
|
|
||||||
/// SharpDevelop.Setup.wixproj.user.template.
|
|
||||||
/// </summary>
|
|
||||||
class UpdateApplication |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Path to the setup project relative to the UpdateSetupInfo.exe file.
|
|
||||||
/// </summary>
|
|
||||||
const string SetupProjectFolderRelativePath = @"..\..\..\Setup"; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Name of the setup template file.
|
|
||||||
/// </summary>
|
|
||||||
const string SetupTemplateFileName = "SharpDevelop.Setup.wixproj.user.template"; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Name of the setup project user file that will be generated.
|
|
||||||
/// </summary>
|
|
||||||
const string SetupProjectUserFileName = "SharpDevelop.Setup.wixproj.user"; |
|
||||||
|
|
||||||
const int SetupTemplateFileNotFoundReturnCode = 1; |
|
||||||
const int UpdateSetupInfoExceptionReturnCode = 2; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The full filename including path to the setup template file.
|
|
||||||
/// </summary>
|
|
||||||
string setupTemplateFullFileName; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The full filename including path to the setup project user file that
|
|
||||||
/// will be generated.
|
|
||||||
/// </summary>
|
|
||||||
string setupProjectUserFullFileName; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The folder containing the UpdateSetupInfo application.
|
|
||||||
/// </summary>
|
|
||||||
string applicationFolder; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The file that contains the last revision number used to update the
|
|
||||||
/// template.
|
|
||||||
/// </summary>
|
|
||||||
string previousRevisionFileName; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The folder that contains the last revision number used to update the
|
|
||||||
/// template.
|
|
||||||
/// </summary>
|
|
||||||
string previousRevisionFolder; |
|
||||||
|
|
||||||
public UpdateApplication() |
|
||||||
{ |
|
||||||
// Work out filenames.
|
|
||||||
applicationFolder = Path.GetDirectoryName(GetType().Assembly.Location); |
|
||||||
string setupProjectFolder = Path.Combine(applicationFolder, SetupProjectFolderRelativePath); |
|
||||||
setupProjectFolder = Path.GetFullPath(setupProjectFolder); |
|
||||||
|
|
||||||
setupTemplateFullFileName = Path.Combine(setupProjectFolder, SetupTemplateFileName); |
|
||||||
setupProjectUserFullFileName = Path.Combine(setupProjectFolder, SetupProjectUserFileName); |
|
||||||
previousRevisionFolder = Path.Combine(setupProjectFolder, @"bin"); |
|
||||||
previousRevisionFileName = Path.Combine(previousRevisionFolder, "REVISION"); |
|
||||||
|
|
||||||
FileCopy(Path.Combine(Path.Combine(applicationFolder, subversionLibraryDir), "SharpSvn.dll"), |
|
||||||
Path.Combine(applicationFolder, "SharpSvn.dll")); |
|
||||||
|
|
||||||
// Set current directory to a folder that is in the repository.
|
|
||||||
Environment.CurrentDirectory = setupProjectFolder; |
|
||||||
} |
|
||||||
|
|
||||||
static void FileCopy(string source, string target) |
|
||||||
{ |
|
||||||
if (File.Exists(target)) { |
|
||||||
// don't copy file if it is up-to-date: repeatedly copying a 3 MB file slows down the build
|
|
||||||
if (File.GetLastWriteTimeUtc(source) == File.GetLastWriteTimeUtc(target)) |
|
||||||
return; |
|
||||||
} |
|
||||||
File.Copy(source, target, true); |
|
||||||
} |
|
||||||
|
|
||||||
public static int Main(string[] args) |
|
||||||
{ |
|
||||||
try { |
|
||||||
UpdateApplication app = new UpdateApplication(); |
|
||||||
return app.Run(); |
|
||||||
} catch (Exception ex) { |
|
||||||
Console.WriteLine(ex.ToString()); |
|
||||||
return UpdateApplication.UpdateSetupInfoExceptionReturnCode; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public int Run() |
|
||||||
{ |
|
||||||
// Read setup template contents.
|
|
||||||
if (!SetupTemplateFileExists) { |
|
||||||
Console.WriteLine(String.Concat(SetupTemplateFileName, " not found. Unable to update setup information.")); |
|
||||||
return SetupTemplateFileNotFoundReturnCode; |
|
||||||
} |
|
||||||
string template = ReadSetupTemplate(); |
|
||||||
|
|
||||||
// Get current revision.
|
|
||||||
string currentRevision = GetCurrentRevision(); |
|
||||||
|
|
||||||
// Populate setup template.
|
|
||||||
template = PopulateSetupTemplate(template, currentRevision); |
|
||||||
|
|
||||||
// Create setup user file.
|
|
||||||
SaveSetupUserFile(template); |
|
||||||
|
|
||||||
return 0; |
|
||||||
} |
|
||||||
|
|
||||||
bool SetupUserFileExists { |
|
||||||
get { return File.Exists(setupProjectUserFullFileName); } |
|
||||||
} |
|
||||||
|
|
||||||
bool SetupTemplateFileExists { |
|
||||||
get { return File.Exists(setupTemplateFullFileName); } |
|
||||||
} |
|
||||||
|
|
||||||
string ReadSetupTemplate() { |
|
||||||
using (StreamReader reader = new StreamReader(setupTemplateFullFileName, true)) { |
|
||||||
return reader.ReadToEnd(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
string PopulateSetupTemplate(string template, string revision) |
|
||||||
{ |
|
||||||
return template.Replace("$INSERTPRODUCTBUILDVERSION$", revision); |
|
||||||
} |
|
||||||
|
|
||||||
string GetNewGuid() |
|
||||||
{ |
|
||||||
return Guid.NewGuid().ToString().ToUpperInvariant(); |
|
||||||
} |
|
||||||
|
|
||||||
void SaveSetupUserFile(string contents) |
|
||||||
{ |
|
||||||
using (StreamWriter writer = new StreamWriter(setupProjectUserFullFileName, false, Encoding.UTF8)) { |
|
||||||
writer.Write(contents); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
const string subversionLibraryDir = @"..\..\..\Libraries\SharpSvn"; |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Code taken directly from UpdateAssemblyInfo and the paths slightly modified.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The product build version maps to the Subversion revision number.
|
|
||||||
/// </remarks>
|
|
||||||
string GetCurrentRevision() |
|
||||||
{ |
|
||||||
string revisionNumber = null; |
|
||||||
string oldWorkingDir = Environment.CurrentDirectory; |
|
||||||
try { |
|
||||||
// Set working directory so msvcp70.dll and msvcr70.dll can be found
|
|
||||||
Environment.CurrentDirectory = Path.Combine(applicationFolder, subversionLibraryDir); |
|
||||||
|
|
||||||
using (SvnClient client = new SvnClient()) { |
|
||||||
client.Info( |
|
||||||
oldWorkingDir, |
|
||||||
(sender, info) => { |
|
||||||
revisionNumber = info.Revision.ToString(CultureInfo.InvariantCulture); |
|
||||||
}); |
|
||||||
} |
|
||||||
} catch (Exception e) { |
|
||||||
Console.WriteLine("Reading revision number with Svn.Net failed: " + e.ToString()); |
|
||||||
} finally { |
|
||||||
Environment.CurrentDirectory = oldWorkingDir; |
|
||||||
} |
|
||||||
if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { |
|
||||||
revisionNumber = ReadCurrentRevisionFromFile(); |
|
||||||
} |
|
||||||
if (revisionNumber == null || revisionNumber.Length == 0 || revisionNumber == "0") { |
|
||||||
throw new ApplicationException("Error reading revision number"); |
|
||||||
} |
|
||||||
return revisionNumber; |
|
||||||
} |
|
||||||
|
|
||||||
string ReadCurrentRevisionFromFile() |
|
||||||
{ |
|
||||||
using (StreamReader reader = new StreamReader(Path.Combine(applicationFolder, @"..\..\..\..\REVISION"))) { |
|
||||||
return reader.ReadLine(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Checks that the current revision matches the revision last used to
|
|
||||||
/// update the SharpDevelop.Setup.wixproj.user file.
|
|
||||||
/// </summary>
|
|
||||||
bool RevisionExists(string currentRevision) |
|
||||||
{ |
|
||||||
// Read previous revision.
|
|
||||||
string previousRevision = ReadPreviousRevision(); |
|
||||||
if (previousRevision != null) { |
|
||||||
return previousRevision == currentRevision; |
|
||||||
} |
|
||||||
return false; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reads the previous revision number from the Setup\bin\REVISION file.
|
|
||||||
/// </summary>
|
|
||||||
string ReadPreviousRevision() |
|
||||||
{ |
|
||||||
if (File.Exists(previousRevisionFileName)) { |
|
||||||
using (StreamReader reader = new StreamReader(previousRevisionFileName, true)) { |
|
||||||
return reader.ReadLine(); |
|
||||||
} |
|
||||||
} |
|
||||||
return null; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,36 +0,0 @@ |
|||||||
|
|
||||||
Updates the SharpDevelop Setup information |
|
||||||
------------------------------------------ |
|
||||||
|
|
||||||
Product Revision (Subversion revision number) |
|
||||||
|
|
||||||
With WiX 3 the package code and product code guids do not need to be generated by |
|
||||||
this tool and can be autogenerated by WiX. |
|
||||||
|
|
||||||
The build server and the buildSetup.bat executes the UpdateSetupInfo tool before |
|
||||||
building SharpDevelop.Setup.sln. The SharpDevelop.Setup project does not use the tool. |
|
||||||
|
|
||||||
Operation |
|
||||||
--------- |
|
||||||
|
|
||||||
1) The SharpDevelop.Setup.wixproj.user is is generated each time the tool is run |
|
||||||
based on the SharpDevelop.Setup.wixproj.user.template file. The product revision is inserted |
|
||||||
into the newly generated file. The last used revision is written to a REVISION |
|
||||||
file which is put in the Setup\bin folder. This not in the repository and is only |
|
||||||
used to stop the tool from regenerating the product guid if the revision number has not |
|
||||||
changed. |
|
||||||
|
|
||||||
2) The build server and buildSetup.bat will run the UpdateSetupInfo tool. |
|
||||||
This is not done by the SharpDevelop.Setup project itself intentionally so |
|
||||||
nothing changes when building the project from inside SharpDevelop. The |
|
||||||
modified SharpDevelop.Setup.wixproj.user need not be checked into the |
|
||||||
repository on each build on the build server. |
|
||||||
|
|
||||||
Creating Releases |
|
||||||
----------------- |
|
||||||
|
|
||||||
When creating a release either the setup msi from the build server should be |
|
||||||
used or that generated after running buildSetup.bat. This will revision number |
|
||||||
if the current revision has changed. |
|
||||||
|
|
||||||
|
|
||||||
@ -1,52 +0,0 @@ |
|||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> |
|
||||||
<PropertyGroup> |
|
||||||
<OutputType>Exe</OutputType> |
|
||||||
<RootNamespace>UpdateSetupInfo</RootNamespace> |
|
||||||
<AssemblyName>UpdateSetupInfo</AssemblyName> |
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
||||||
<ProjectGuid>{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}</ProjectGuid> |
|
||||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
|
||||||
<NoStdLib>False</NoStdLib> |
|
||||||
<RegisterForComInterop>False</RegisterForComInterop> |
|
||||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
|
||||||
<BaseAddress>4194304</BaseAddress> |
|
||||||
<PlatformTarget>x86</PlatformTarget> |
|
||||||
<FileAlignment>4096</FileAlignment> |
|
||||||
<WarningLevel>4</WarningLevel> |
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
|
||||||
<OutputPath>bin</OutputPath> |
|
||||||
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> |
|
||||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
|
||||||
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath> |
|
||||||
<Optimize>False</Optimize> |
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||||
<DebugSymbols>true</DebugSymbols> |
|
||||||
<DebugType>Full</DebugType> |
|
||||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
|
||||||
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath> |
|
||||||
<Optimize>True</Optimize> |
|
||||||
<DefineConstants>TRACE</DefineConstants> |
|
||||||
<DebugSymbols>False</DebugSymbols> |
|
||||||
<DebugType>None</DebugType> |
|
||||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
|
||||||
</PropertyGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Reference Include="SharpSvn"> |
|
||||||
<HintPath>..\..\Libraries\SharpSvn\SharpSvn.dll</HintPath> |
|
||||||
<Private>False</Private> |
|
||||||
</Reference> |
|
||||||
<Reference Include="System" /> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Compile Include="Main.cs" /> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<Content Include="Readme.txt" /> |
|
||||||
</ItemGroup> |
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
|
||||||
</Project> |
|
||||||
@ -1,18 +0,0 @@ |
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00 |
|
||||||
# Visual Studio 2008 |
|
||||||
# SharpDevelop 3.1.0.3932 |
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateSetupInfo", "UpdateSetupInfo.csproj", "{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}" |
|
||||||
EndProject |
|
||||||
Global |
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
||||||
Debug|Any CPU = Debug|Any CPU |
|
||||||
Release|Any CPU = Release|Any CPU |
|
||||||
EndGlobalSection |
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
||||||
{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
||||||
{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
||||||
{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Release|Any CPU.Build.0 = Release|Any CPU |
|
||||||
{75E6D78C-DC66-40F1-90AC-F9F97ADE3506}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
||||||
EndGlobalSection |
|
||||||
EndGlobal |
|
||||||
Loading…
Reference in new issue