Support for product version supplied by AppVeyor (#12)

* Set version of binaries based on CS_VERSION environment variable
* Use AppVeyor supplied product version
* Automatically generate ProductCode GUID
* Convert version (CS_VERSION) to number (CS_VERSION_NUM)
This commit is contained in:
ge0rdi
2018-02-05 08:48:15 +01:00
committed by GitHub
parent 1595967c27
commit 11bd5fa5f9
25 changed files with 123 additions and 47 deletions

View File

@@ -1,10 +1,3 @@
@REM !!!!! CHANGE THE GUIDS WHEN CHANGING THE VERSION !!!!!
SET CS_VERSION=4.3.1
SET CS_VERSION_STR=4_3_1
SET CS_VERSION_NUM=40301
SET CS_GUID32=8A99142D-5D6E-40b6-AF88-8BD46F0C5CB4
SET CS_GUID64=CABCE573-0A86-42fa-A52A-C7EA61D5BE08
REM ********* Build Help
@setlocal EnableDelayedExpansion
@if %CS_HAS_HELP%==1 (
@@ -35,6 +28,12 @@ del /Q Temp\*.*
@if not exist ..\Localization\%CS_LANG_FOLDER%\ClassicShellText-%CS_LANG_NAME%.wxl exit /b 1
@REM Convvert CS_VERSION (X.Y.Z) into number (XXYYZZZZ)
@set CS_VERSION_NUM=0
@for /f "tokens=1,2,3 delims=." %%A in ("%CS_VERSION%") do (
@set /a "CS_VERSION_NUM=%%A<<24|%%B<<16|%%C"
)
REM ********* Build 32-bit MSI
candle ClassicShellSetup.wxs -out Temp\ClassicShellSetup32.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=0 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
@if ERRORLEVEL 1 exit /b 1

View File

@@ -62,8 +62,8 @@ IDI_APPICON ICON "ClassicShell.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,3,1,0
PRODUCTVERSION 4,3,1,0
FILEVERSION _PRODUCT_VERSION
PRODUCTVERSION _PRODUCT_VERSION
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -80,12 +80,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "IvoSoft"
VALUE "FileDescription", "Adds classic shell features to Windows 7 and Windows 8"
VALUE "FileVersion", "4, 3, 1, 0"
VALUE "FileVersion", _PRODUCT_VERSION_STR
VALUE "InternalName", "ClassicShellSetup"
VALUE "LegalCopyright", "Copyright (C) 2009-2016, Ivo Beltchev"
VALUE "OriginalFilename", "ClassicShellSetup.exe"
VALUE "ProductName", "Classic Shell"
VALUE "ProductVersion", "4, 3, 1, 0"
VALUE "ProductVersion", _PRODUCT_VERSION_STR
END
END
BLOCK "VarFileInfo"

View File

@@ -32,9 +32,11 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\Version.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

View File

@@ -7,20 +7,18 @@
lightArgs: "<projectname>.wixobj" -out "<projectname>.msi" -ext WixUIExtension -ext WixUtilExtension -loc ClassicShellText-en-US.wxl
-->
<?if $(var.x64)=1 ?>
<?define CS_GUID = "$(env.CS_GUID64)"?>
<?define CS_UPGRADE = "779A74EF-23DE-4C71-AC12-2EE5A542ED34"?>
<?define CS_PLATFORM = "x64"?>
<?define CS_PROGRAM_FILES = "ProgramFiles64Folder"?>
<?define CS_WIN64 = "yes"?>
<?else ?>
<?define CS_GUID = "$(env.CS_GUID32)"?>
<?define CS_UPGRADE = "EB7DA1D9-44EA-43BF-8A08-0B103007D4F2"?>
<?define CS_PLATFORM = "x86"?>
<?define CS_PROGRAM_FILES = "ProgramFilesFolder"?>
<?define CS_WIN64 = "no"?>
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="$(var.CS_GUID)" Name="Classic Shell" Language="1033" Version="$(env.CS_VERSION)" Manufacturer="IvoSoft" UpgradeCode="$(var.CS_UPGRADE)">
<Product Id="*" Name="Classic Shell" Language="1033" Version="$(env.CS_VERSION)" Manufacturer="IvoSoft" UpgradeCode="$(var.CS_UPGRADE)">
<Package Description="Classic Shell" Comments="Classic Shell" InstallerVersion="500" Compressed="yes" Platform="$(var.CS_PLATFORM)" />
<Media Id="1" Cabinet="cshell.cab" EmbedCab="yes" CompressionLevel="high"/>
<Media Id="2" Cabinet="simple.cab" EmbedCab="yes" CompressionLevel="high"/>

View File

@@ -687,7 +687,7 @@ static void WriteLogFile( FILE *f )
DWORD val;
if (regKey.QueryDWORDValue(L"Version",val)==ERROR_SUCCESS)
fwprintf(f,L"\tClassic Shell version: %d.%d.%d\r\n",val/10000,(val/100)%100,val%100);
fwprintf(f,L"\tClassic Shell version: %d.%d.%d\r\n",val>>24,(val>>16)&0xFF,val&0xFFFF);
if (regKey.QueryDWORDValue(L"WinVersion",val)==ERROR_SUCCESS)
fwprintf(f,L"\tWin version during installation: %d.%02d.%d\r\n",val>>24,(val>>16)&0xFF,val&0xFFFF);

View File

@@ -113,36 +113,47 @@
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.3.1|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.3.0|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.7|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.6|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.5|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.4|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.3|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.2|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.1|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.2.0|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='update_4.1.0|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Version.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='update_4.1.0|Win32'">

View File

@@ -1,5 +1,15 @@
@cd %~dp0
@rem Default version
@set CS_VERSION=4.4.0
@if defined APPVEYOR_BUILD_VERSION (
@set CS_VERSION=%APPVEYOR_BUILD_VERSION%
)
@rem Convert . to _
@set CS_VERSION_STR=%CS_VERSION:.=_%
@call BuildBinaries.bat
@if ERRORLEVEL 1 exit /b 1