Eusebiu Marcu 15 years ago
parent
commit
72ca41243d
  1. 1
      src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml
  2. 2
      src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs
  3. 3
      src/Main/GlobalAssemblyInfo.template
  4. 14
      src/Setup/Files.wxs
  5. 32
      src/Setup/Setup.wxs
  6. 4
      src/Setup/SharpDevelop.Setup.wixproj.user.template
  7. 34
      src/Tools/UpdateAssemblyInfo/Main.cs

1
src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml

@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
Stretch="Fill"
Source="../Resources/balken_mitte.gif" />
</DockPanel>
<TextBlock Grid.Row="0" Margin="4" TextAlignment="Right" VerticalAlignment="Bottom" Name="versionTextBlock" />
<ItemsControl
Name="startPageItems"
Focusable="False"

2
src/AddIns/Misc/StartPage/Project/Src/StartPageControl.xaml.cs

@ -26,6 +26,8 @@ namespace ICSharpCode.StartPage @@ -26,6 +26,8 @@ namespace ICSharpCode.StartPage
var aca = (AssemblyCopyrightAttribute)typeof(CommonAboutDialog).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0];
copyrightText.Text = aca.Copyright;
versionTextBlock.Text = "SharpDevelop " + RevisionClass.FullVersion;
}
sealed class BoxEntry

3
src/Main/GlobalAssemblyInfo.template

@ -30,6 +30,7 @@ internal static class RevisionClass @@ -30,6 +30,7 @@ internal static class RevisionClass
public const string Minor = "1";
public const string Build = "0";
public const string Revision = "$INSERTREVISION$";
public const string VersionName = "alpha";
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$";
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$";
}

14
src/Setup/Files.wxs

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<!-- SharpDevelop installation directory and files -->
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="SharpDevelopFolder" Name="SharpDevelop">
<Directory Id="INSTALLDIR" Name="4.1">
<Directory Id="INSTALLDIR" Name="$(var.PRODUCTMAJORVERSION)">
<Directory Id="BinFolder" Name="bin">
<Component Id="SharpDevelopExe" Guid="F632C62C-A4DD-4507-9678-C7DCFF4DBC8C" DiskId="1">
<File Id="SharpDevelop.exe" Name="SharpDevelop.exe" Source="..\..\bin\SharpDevelop.exe" Assembly=".net" AssemblyApplication="SharpDevelop.exe" AssemblyManifest="SharpDevelop.exe" KeyPath="yes">
@ -1528,24 +1528,24 @@ @@ -1528,24 +1528,24 @@
</Directory>
<!-- SharpDevelop Start menu folder -->
<Directory Id="ProgramMenuFolder" Name="Programs">
<Component Id="SharpDevelopProgramMenuItems" Guid="A505F0F2-5971-436D-8E3E-ABDDC0B59BF7">
<Component Id="SharpDevelopProgramMenuItems" Guid="212A9717-E2C6-4522-AB76-9B92B7FB7FB6">
<!--
Fix ICE 38 by adding a dummy registry key that is the key for this shortcut.
http://msdn.microsoft.com/library/en-us/msi/setup/ice38.asp
-->
<RegistryValue Id="SharpDevelopExeStartMenuShortcutRegistryKey" Root="HKCU" Type="string" KeyPath="yes" Key="Software\SharpDevelop4" Name="ProgramFilesShortcut" Value="1" />
<Shortcut Name="SharpDevelop 4.1" Target="[!SharpDevelop.exe]" Id="SharpDevelopExeStartMenuShortcut" WorkingDirectory="BinFolder" Icon="SharpDevelopIcon.exe" Directory="ProgramMenuFolder" />
<RegistryValue Id="SharpDevelopExeStartMenuShortcutRegistryKey" Root="HKCU" Type="string" KeyPath="yes" Key="Software\SharpDevelop\$(var.PRODUCTMAJORVERSION)" Name="ProgramFilesShortcut" Value="1" />
<Shortcut Name="SharpDevelop $(var.PRODUCTDISPLAYVERSION)" Target="[!SharpDevelop.exe]" Id="SharpDevelopExeStartMenuShortcut" WorkingDirectory="BinFolder" Icon="SharpDevelopIcon.exe" Directory="ProgramMenuFolder" />
</Component>
</Directory>
<!-- Desktop shortcuts -->
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="DesktopFolderItems" Guid="F2FF4C2F-6282-4ABA-8DBB-E50E81B5920D">
<Component Id="DesktopFolderItems" Guid="03C3A248-04B0-4DE7-B4BA-C2D7275AA9FA">
<!--
Fix ICE 38 by adding a dummy registry key that is the key for this shortcut.
http://msdn.microsoft.com/library/en-us/msi/setup/ice38.asp
-->
<RegistryValue Id="SharpDevelopExeDesktopShortcutRegistryKey" Type="string" Root="HKCU" KeyPath="yes" Key="Software\SharpDevelop4" Name="DesktopShortcut" Value="1" />
<Shortcut Id="SharpDevelopExeDesktopShortcut" Directory="DesktopFolder" Target="[!SharpDevelop.exe]" Name="SharpDevelop 4.1" Icon="SharpDevelopIcon.exe" WorkingDirectory="BinFolder" />
<RegistryValue Id="SharpDevelopExeDesktopShortcutRegistryKey" Type="string" Root="HKCU" KeyPath="yes" Key="Software\SharpDevelop\$(var.PRODUCTMAJORVERSION)" Name="DesktopShortcut" Value="1" />
<Shortcut Id="SharpDevelopExeDesktopShortcut" Directory="DesktopFolder" Target="[!SharpDevelop.exe]" Name="SharpDevelop $(var.PRODUCTDISPLAYVERSION)" Icon="SharpDevelopIcon.exe" WorkingDirectory="BinFolder" />
</Component>
</Directory>
</DirectoryRef>

32
src/Setup/Setup.wxs

@ -4,18 +4,26 @@ @@ -4,18 +4,26 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!--
Windows Installer only recognises 3 digits for the product version (Major.Minor.Build)
so the third digit must be the Subversion revision.
so the third digit must be the revision number.
-->
<!-- PRODUCTMAJORVERSION is major.minor (e.g. 4.1), retrieved from GlobalAssemblyInfo.template -->
<!-- PRODUCTBUILDVERSION is the revision number (e.g. 6963), calculated from git -->
<!-- PRODUCTDISPLAYVERSION is a string like "4.1 Beta 1" (version name retrieved from GlobalAssemblyInfo.template) -->
<Product Id="*"
Name="SharpDevelop 4.1"
Name="SharpDevelop $(var.PRODUCTDISPLAYVERSION)"
Manufacturer="ic#code"
Language="1033"
Codepage="1252"
UpgradeCode="53805F5D-AC04-4592-8078-6EB7164D8C15"
Version="4.1.$(var.PRODUCTBUILDVERSION)">
Version="$(var.PRODUCTMAJORVERSION).$(var.PRODUCTBUILDVERSION)">
<!-- When a new major SharpDevelop version should be allowed to be installed in parallel to old versions,
we need a new upgrade code (2 occurrences!), and the "Minimum Version" for upgrades needs to be adjusted.
-->
<Package Description="SharpDevelop 4.1.0.$(var.PRODUCTBUILDVERSION)"
<Package Description="SharpDevelop $(var.PRODUCTDISPLAYVERSION)"
InstallerVersion="300"
Compressed="yes"/>
@ -26,13 +34,13 @@ @@ -26,13 +34,13 @@
<!-- Checks for older versions -->
<UpgradeVersion Minimum="4.1.0"
IncludeMinimum="yes"
Maximum="4.1.$(var.PRODUCTBUILDVERSION)"
Maximum="$(var.PRODUCTMAJORVERSION).$(var.PRODUCTBUILDVERSION)"
IncludeMaximum="no"
Property="PREVIOUSVERSIONFOUND"/>
<!-- Checks for newer versions -->
<UpgradeVersion OnlyDetect="yes"
Property="NEWERVERSIONFOUND"
Minimum="4.1.$(var.PRODUCTBUILDVERSION)"
Minimum="$(var.PRODUCTMAJORVERSION).$(var.PRODUCTBUILDVERSION)"
IncludeMinimum="no"/>
</Upgrade>
@ -145,7 +153,7 @@ @@ -145,7 +153,7 @@
each be a feature if the user wants to heavily customise the installation.
-->
<Feature Id="Complete"
Title="SharpDevelop 4.1"
Title="SharpDevelop $(var.PRODUCTMAJORVERSION)"
Description="Installs SharpDevelop and registers file associations"
Level="1"
ConfigurableDirectory="INSTALLDIR"
@ -601,8 +609,7 @@ @@ -601,8 +609,7 @@
<UIRef Id="WixUI_FeatureTree"/>
<!--
If a newer version of SharpDevelop 4.1 is installed show an
error message.
If a newer version of SharpDevelop is installed, show an error message.
This message is not displayed immediately, the FindRelatedProducts
action occurs well into the installation after the user has
@ -615,13 +622,16 @@ @@ -615,13 +622,16 @@
<!--
Display an error message if a newer version found.
Since the installer completely removes the existing SharpDevelop 4.1
Since the installer completely removes the existing SharpDevelop installation,
downgrades would work without any problems, but for now we
inform the user that a newer version already exists.
-> Actually, there's trouble with downgrades because Windows Installer first determines
the existing components before removing the old installation; so all versioned
libraries will get removed instead of downgraded.
-->
<Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERVERSIONFOUND</Custom>
<!--
Removes the older version of SharpDevelop 4.1, if we are upgrading,
Removes the older version of SharpDevelop, if we are upgrading,
before installing the new version.
Unfortunately the user is not informed of this upgrade. I think

4
src/Setup/SharpDevelop.Setup.wixproj.user.template

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<SetupProductMajorVersion>$INSERTMAJORVERSION$</SetupProductMajorVersion>
<SetupProductBuildVersion>$INSERTREVISION$</SetupProductBuildVersion>
<DefineConstants>PRODUCTBUILDVERSION=$(SetupProductBuildVersion)</DefineConstants>
<SetupProductDisplayVersion>$INSERTMAJORVERSION$ $INSERTVERSIONNAME$</SetupProductDisplayVersion>
<DefineConstants>PRODUCTMAJORVERSION=$(SetupProductMajorVersion);PRODUCTBUILDVERSION=$(SetupProductBuildVersion);PRODUCTDISPLAYVERSION=$(SetupProductDisplayVersion)</DefineConstants>
</PropertyGroup>
</Project>

34
src/Tools/UpdateAssemblyInfo/Main.cs

@ -92,7 +92,8 @@ namespace UpdateAssemblyInfo @@ -92,7 +92,8 @@ namespace UpdateAssemblyInfo
new XElement("version", fullVersionNumber),
new XElement("revision", revisionNumber),
new XElement("commitHash", gitCommitHash),
new XElement("branchName", gitBranchName)
new XElement("branchName", gitBranchName),
new XElement("versionName", versionName)
));
doc.Save("REVISION");
}
@ -112,6 +113,7 @@ namespace UpdateAssemblyInfo @@ -112,6 +113,7 @@ namespace UpdateAssemblyInfo
content = r.ReadToEnd();
}
content = content.Replace("$INSERTVERSION$", fullVersionNumber);
content = content.Replace("$INSERTMAJORVERSION$", majorVersionNumber);
content = content.Replace("$INSERTREVISION$", revisionNumber);
content = content.Replace("$INSERTCOMMITHASH$", gitCommitHash);
content = content.Replace("$INSERTSHORTCOMMITHASH$", gitCommitHash.Substring(0, 8));
@ -120,6 +122,10 @@ namespace UpdateAssemblyInfo @@ -120,6 +122,10 @@ namespace UpdateAssemblyInfo
content = content.Replace("$INSERTBRANCHNAME$", gitBranchName);
bool isDefaultBranch = string.IsNullOrEmpty(gitBranchName) || gitBranchName == "master" || char.IsDigit(gitBranchName, 0);
content = content.Replace("$INSERTBRANCHPOSTFIX$", isDefaultBranch ? "" : ("-" + gitBranchName));
content = content.Replace("$INSERTVERSIONNAME$", versionName ?? "");
content = content.Replace("$INSERTVERSIONNAMEPOSTFIX$", string.IsNullOrEmpty(versionName) ? "" : "-" + versionName);
if (File.Exists(file.Output)) {
using (StreamReader r = new StreamReader(file.Output)) {
if (r.ReadToEnd() == content) {
@ -135,9 +141,11 @@ namespace UpdateAssemblyInfo @@ -135,9 +141,11 @@ namespace UpdateAssemblyInfo
}
}
static string GetMajorVersion()
static void GetMajorVersion()
{
string version = "?";
majorVersionNumber = "?";
fullVersionNumber = "?";
versionName = null;
// Get main version from startup
using (StreamReader r = new StreamReader(globalAssemblyInfoTemplateFile)) {
string line;
@ -146,23 +154,28 @@ namespace UpdateAssemblyInfo @@ -146,23 +154,28 @@ namespace UpdateAssemblyInfo
int pos = line.IndexOf(search);
if (pos >= 0) {
int e = line.IndexOf('"', pos + search.Length + 1);
version = line.Substring(pos + search.Length, e - pos - search.Length);
majorVersionNumber = line.Substring(pos + search.Length, e - pos - search.Length);
}
search = "string Minor = \"";
pos = line.IndexOf(search);
if (pos >= 0) {
int e = line.IndexOf('"', pos + search.Length + 1);
version = version + "." + line.Substring(pos + search.Length, e - pos - search.Length);
majorVersionNumber = majorVersionNumber + "." + line.Substring(pos + search.Length, e - pos - search.Length);
}
search = "string Build = \"";
pos = line.IndexOf(search);
if (pos >= 0) {
int e = line.IndexOf('"', pos + search.Length + 1);
version = version + "." + line.Substring(pos + search.Length, e - pos - search.Length);
fullVersionNumber = majorVersionNumber + "." + line.Substring(pos + search.Length, e - pos - search.Length) + "." + revisionNumber;
}
search = "string VersionName = \"";
pos = line.IndexOf(search);
if (pos >= 0) {
int e = line.IndexOf('"', pos + search.Length + 1);
versionName = line.Substring(pos + search.Length, e - pos - search.Length);
}
}
}
return version;
}
static void SetVersionInfo(string fileName, Regex regex, string replacement)
@ -181,7 +194,12 @@ namespace UpdateAssemblyInfo @@ -181,7 +194,12 @@ namespace UpdateAssemblyInfo
#region Retrieve Revision Number
static string revisionNumber;
static string majorVersionNumber;
static string fullVersionNumber;
/// <summary>
/// Descriptive version name, e.g. 'Beta 3'
/// </summary>
static string versionName;
static string gitCommitHash;
static string gitBranchName;
@ -199,7 +217,7 @@ namespace UpdateAssemblyInfo @@ -199,7 +217,7 @@ namespace UpdateAssemblyInfo
if (revisionNumber == null) {
ReadRevisionFromFile();
}
fullVersionNumber = GetMajorVersion() + "." + revisionNumber;
GetMajorVersion();
}
static void ReadRevisionNumberFromGit()

Loading…
Cancel
Save