diff --git a/Build/Build.bat b/Build/Build.bat index d558aef4..0ff4dbdd 100644 --- a/Build/Build.bat +++ b/Build/Build.bat @@ -12,6 +12,10 @@ set VERSION_SUBMINOR=1 set VERSION_REVISION=0 set ISBETA=true +set VERSION_FULL=%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_SUBMINOR%.%VERSION_REVISION% +set VERSION_SHORT=%VERSION_MAJOR%.%VERSION_MINOR% +if not "%VERSION_SUBMINOR%" == "0" set VERSION_SHORT=!VERSION_SHORT!.%VERSION_SUBMINOR% + if "%1" == "RELEASE" set ISBETA=false if "%1" == "BUILDVERSION" goto BUILDVERSION echo Rainmeter Build @@ -47,13 +51,11 @@ for /f "usebackq delims= " %%G in (`"%GIT%" rev-list --all --count`) do set VERS :UPDATEVERSION -set VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_SUBMINOR%.%VERSION_REVISION% - :: Update Version.h > "..\Version.h" echo #pragma once >>"..\Version.h" echo #define FILEVER %VERSION_MAJOR%,%VERSION_MINOR%,%VERSION_SUBMINOR%,%VERSION_REVISION% >>"..\Version.h" echo #define PRODUCTVER FILEVER ->>"..\Version.h" echo #define STRFILEVER "%VERSION%" +>>"..\Version.h" echo #define STRFILEVER "%VERSION_FULL%" >>"..\Version.h" echo #define STRPRODUCTVER STRFILEVER >>"..\Version.h" echo #define APPVERSION L"%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_SUBMINOR%" >>"..\Version.h" echo #define RAINMETER_VERSION ((%VERSION_MAJOR% * 1000000) + (%VERSION_MINOR% * 1000) + %VERSION_SUBMINOR%) @@ -66,9 +68,9 @@ set VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_SUBMINOR%.%VERSION_REVISION >>"..\Version.cs" echo public class Version >>"..\Version.cs" echo { >>"..\Version.cs" echo #if X64 ->>"..\Version.cs" echo public const string Informational = "%VERSION% (64-bit)"; +>>"..\Version.cs" echo public const string Informational = "%VERSION_FULL% (64-bit)"; >>"..\Version.cs" echo #else ->>"..\Version.cs" echo public const string Informational = "%VERSION% (32-bit)"; +>>"..\Version.cs" echo public const string Informational = "%VERSION_FULL% (32-bit)"; >>"..\Version.cs" echo #endif >>"..\Version.cs" echo } >>"..\Version.cs" echo } @@ -135,24 +137,23 @@ if not "%CERTFILE%" == "" ( :: Build installer echo * Building installer -set INSTALLER_VERSION=%VERSION_MAJOR%.%VERSION_MINOR% -if not "%VERSION_SUBMINOR%" == "0" set INSTALLER_VERSION=!INSTALLER_VERSION!.%VERSION_SUBMINOR% +set INSTALLER_NAME=Rainmeter-%VERSION_SHORT%.exe +if not "%1" == "RELEASE" set INSTALLER_NAME=Rainmeter-%VERSION_SHORT%-r%VERSION_REVISION%-beta.exe -if "%1" == "RELEASE" ( - "%MAKENSIS%" /DREV="%VERSION_REVISION%" /DVER="%INSTALLER_VERSION%" .\Installer\Installer.nsi > "BuildLog.txt" -) else ( - "%MAKENSIS%" /DBETA /DREV="%VERSION_REVISION%" /DVER="%INSTALLER_VERSION%" .\Installer\Installer.nsi > "BuildLog.txt" -) +set INSTALLER_DEFINES=^ + /DOUTFILE="%INSTALLER_NAME%"^ + /DVERSION_FULL="%VERSION_FULL%"^ + /DVERSION_SHORT="%VERSION_SHORT%"^ + /DVERSION_REVISION="%VERSION_REVISION%" +if not "%1" == "RELEASE" set INSTALLER_DEFINES=!INSTALLER_DEFINES! /DBETA + +"%MAKENSIS%" %INSTALLER_DEFINES% .\Installer\Installer.nsi > "BuildLog.txt" if not %ERRORLEVEL% == 0 echo ERROR %ERRORLEVEL%: Building installer failed & goto END :: Sign installer if not "%CERTFILE%" == "" ( echo * Signing installer - if "%1" == "RELEASE" ( - %SIGNTOOL% Rainmeter-%INSTALLER_VERSION%.exe > BuildLog.txt - ) else ( - %SIGNTOOL% Rainmeter-%INSTALLER_VERSION%-r%VERSION_REVISION%-beta.exe > BuildLog.txt - ) + %SIGNTOOL% %INSTALLER_NAME% > BuildLog.txt if not %ERRORLEVEL% == 0 echo ERROR %ERRORLEVEL%: Signing installer failed & goto END ) diff --git a/Build/Installer/Installer.nsi b/Build/Installer/Installer.nsi index afc41d94..2f6edac7 100644 --- a/Build/Installer/Installer.nsi +++ b/Build/Installer/Installer.nsi @@ -25,26 +25,23 @@ !include "WinVer.nsh" !include "UAC.nsh" -!ifndef VER - !define VER "0.0" - !define REV "000" +!ifndef OUTFILE + !define OUTFILE "Rainmeter-test.exe" + !define VERSION_FULL "0.0.0.0" + !define VERSION_SHORT "0.0" + !define VERSION_REVISION "000" !else !define INCLUDEFILES !endif -!ifdef BETA - !define OUTFILE "Rainmeter-${VER}-r${REV}-beta.exe" -!else - !define OUTFILE "Rainmeter-${VER}.exe" -!endif Name "Rainmeter" VIAddVersionKey "ProductName" "Rainmeter" VIAddVersionKey "FileDescription" "Rainmeter Installer" -VIAddVersionKey "FileVersion" "${VER}.0" -VIAddVersionKey "ProductVersion" "${VER}.0.${REV}" +VIAddVersionKey "FileVersion" "${VERSION_FULL}" +VIAddVersionKey "ProductVersion" "${VERSION_FULL}" VIAddVersionKey "OriginalFilename" "${OUTFILE}" -VIAddVersionKey "LegalCopyright" "Copyright (C) 2009-2012 - All authors" -VIProductVersion "${VER}.0.${REV}" +VIAddVersionKey "LegalCopyright" "Copyright (C) 2009-2013 - All authors" +VIProductVersion "${VERSION_FULL}" BrandingText " " SetCompressor /SOLID lzma RequestExecutionLevel user @@ -115,7 +112,7 @@ Function .onInit ${OrIf} ${IsWin2003} ${AndIf} ${AtMostServicePack} 0 ${IfNot} ${Silent} - MessageBox MB_OK|MB_ICONSTOP "Windows XP SP2 or later is required to install Rainmeter ${VER}." + MessageBox MB_OK|MB_ICONSTOP "Rainmeter requires Windows XP SP2 or later." ${EndIf} SetErrorLevel ${ERROR_UNSUPPORTED} Quit @@ -124,7 +121,7 @@ Function .onInit System::Call 'kernel32::IsProcessorFeaturePresent(i${PF_XMMI_INSTRUCTIONS_AVAILABLE})i.r0' ${If} $0 = 0 ${IfNot} ${Silent} - MessageBox MB_OK|MB_ICONSTOP "A Pentium III or later processor is required to install Rainmeter ${VER}." + MessageBox MB_OK|MB_ICONSTOP "Rainmeter requires a Pentium III or later processor." ${EndIf} SetErrorLevel ${ERROR_UNSUPPORTED} Quit @@ -732,9 +729,9 @@ SkipIniMove: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "UninstallString" "$INSTDIR\uninst.exe" !ifdef BETA - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "DisplayVersion" "${VER} beta r${REV}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "DisplayVersion" "${VERSION_SHORT} beta r${VERSION_REVISION}" !else - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "DisplayVersion" "${VER} r${REV}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "DisplayVersion" "${VERSION_SHORT} r${VERSION_REVISION}" !endif ; Create .rmskin association @@ -941,12 +938,14 @@ Section Uninstall Sleep 500 ${Next} + ; Old stuff + RMDir /r "$INSTDIR\Addons" + RMDir /r "$INSTDIR\Fonts" + RMDir /r "$INSTDIR\Defaults" RMDir /r "$INSTDIR\Languages" RMDir /r "$INSTDIR\Plugins" RMDir /r "$INSTDIR\Skins" - RMDir /r "$INSTDIR\Addons" - RMDir /r "$INSTDIR\Fonts" Delete "$INSTDIR\Rainmeter.dll" Delete "$INSTDIR\Rainmeter.exe" Delete "$INSTDIR\Rainmeter.exe.config"