-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUpgrade.cmd
More file actions
30 lines (24 loc) · 1.54 KB
/
Upgrade.cmd
File metadata and controls
30 lines (24 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@ECHO OFF
REM Run this file to upgrade the solution to a new version.
:start
SET /p NewVersionInput="Enter the new version number (X.X.X.X): "
ECHO.
FOR /F "tokens=*" %%i in ('RegExSelect "." "\d+\.\d+\.\d+\.\d+" "%NewVersionInput%"') do SET NewVersion=%%i
IF "%NewVersion%"=="" GOTO start
ECHO.
FOR /F "tokens=*" %%i in ('RegExReplace . "(\d+)\.(\d+)\.(\d+)\.(\d+)" "$1.$2.$4" "%NewVersion%"') do SET NewVersionMin=%%i
RegExReplace ".\BalancingPlugin\Properties\AssemblyInfo.cs" "^\[assembly: AssemblyVersion\("".*""\)" "[assembly: AssemblyVersion(""%NewVersion%"")"
RegExReplace ".\BalancingPlugin\Properties\AssemblyInfo.cs" "^\[assembly: AssemblyFileVersion\("".*""\)" "[assembly: AssemblyFileVersion(""%NewVersion%"")"
RegExReplace ".\BalancingPluginSetup\AddIn.xml" "<Version>.*</Version>" "<Version>%NewVersionMin%</Version>"
RegExReplace ".\BalancingPluginSetup\Server.ddf" "_\d+\.\d+\.\d+\.\d+\.wssx" "_%NewVersion%.wssx"
RegExReplace ".\BalancingPluginSetup\Server.wxs" " ProductVersion="".*""" " ProductVersion=""%NewVersionMin%"""
RegExReplace ".\BalancingPluginWindowsSetup\BalancingPlugin.wxs" " ProductVersion="".*""" " ProductVersion=""%NewVersionMin%"""
RegExReplace ".\BalancingPluginWindowsSetup\BalancingPluginWindowsSetup.wixproj" "_\d+\.\d+\.\d+\.\d+</OutputName>" "_%NewVersion%</OutputName>"
REM If you want to sign your plug-ins, create a Sign.cmd to do that and uncomment this line to upgrade it as well.
REM RegExReplace "Sign.cmd" "_\d+\.\d+\.\d+\.\d+(?=[._])" "_%NewVersion%"
:end
ECHO Done.
ECHO.
ECHO Open the solution and build it.
ECHO.
PAUSE