Skip to content

Commit

Permalink
2024-08-25 - Version bump + Updater
Browse files Browse the repository at this point in the history
For #355. Changes file versions for all .exes, installers, etc.
  • Loading branch information
TCNOco committed Aug 25, 2024
1 parent 4f72f64 commit f3ed313
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Installer/Installer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ IDI_ICON1 ICON "..\\TcNo-Acc-Switcher-Tray\\fav
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEVERSION 2024,08,25,00
PRODUCTVERSION 2024,08,25,00
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "TroubleChute (Wesley Pyburn)"
VALUE "FileDescription", "Easy redistributable installer for the TcNo Account Switcher"
VALUE "FileVersion", "1.0.0.1"
VALUE "FileVersion", "2024.08.25.00"
VALUE "InternalName", "_First_R.exe"
VALUE "LegalCopyright", "Copyright � TroubleChute (Wesley Pyburn) 2019-2024"
VALUE "OriginalFilename", "_First_Run_Installer.exe"
VALUE "ProductName", "TcNo Account Switcher - Redistributable Installer"
VALUE "ProductVersion", "1.0.0.1"
VALUE "ProductVersion", "2024.08.25.00"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 2 additions & 2 deletions TcNo-Acc-Switcher-Client/TcNo-Acc-Switcher-Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<RootNamespace>TcNo_Acc_Switcher_Client</RootNamespace>
<UseWPF>true</UseWPF>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<Version>4.1.0</Version>
<Version>2024.08.25.00</Version>
<Authors>TroubleChute (Wesley Pyburn)</Authors>
<Product>TcNo Account Switcher</Product>
<Copyright>Copyright © TroubleChute (Wesley Pyburn) 2019-2024</Copyright>
<PackageProjectUrl>https://github.com/TcNobo/TcNo-Acc-Switcher</PackageProjectUrl>
<PackageIcon>TcNoAccSw-Icon-100x100.png</PackageIcon>
<RepositoryUrl>https://github.com/TcNobo/TcNo-Acc-Switcher</RepositoryUrl>
<AssemblyName>TcNo-Acc-Switcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>2024.08.25.00</AssemblyVersion>
<Platforms>x64</Platforms>
<SignAssembly>false</SignAssembly>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
2 changes: 1 addition & 1 deletion TcNo-Acc-Switcher-Globals/Globals.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// TcNo Account Switcher - A Super fast account switcher
// TcNo Account Switcher - A Super fast account switcher
// Copyright (C) 2019-2024 TroubleChute (Wesley Pyburn)
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions TcNo-Acc-Switcher-Server/TcNo-Acc-Switcher-Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>TcNo_Acc_Switcher_Server</RootNamespace>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Version>4.0.0</Version>
<Version>2024.08.25.00</Version>
<Authors>TroubleChute (Wesley Pyburn)</Authors>
<Product>TcNo Account Switcher - Server</Product>
<Copyright>Copyright © TroubleChute (Wesley Pyburn) 2022</Copyright>
Expand Down Expand Up @@ -266,4 +266,4 @@
<TypeScriptMapRoot />
<TypeScriptSourceRoot />
</PropertyGroup>
</Project>
</Project>
8 changes: 4 additions & 4 deletions _Updater_Wrapper/_Wrapper.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ IDI_ICON1 ICON "..\\TcNo-Acc-Switcher-Tray\\fav
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEVERSION 2024,08,25,00
PRODUCTVERSION 2024,08,25,00
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "TroubleChute (Wesley Pyburn)"
VALUE "FileDescription", "TcNo Account Switcher Wrapper"
VALUE "FileVersion", "1.0.0.0"
VALUE "FileVersion", "2024.08.25.00"
VALUE "InternalName", "_Wrap.exe"
VALUE "LegalCopyright", "Copyright � TroubleChute (Wesley Pyburn) 2019-2024"
VALUE "OriginalFilename", "_Wrapper.exe"
VALUE "ProductName", "TcNo Account Switcher - Wrapper"
VALUE "ProductVersion", "1.0.0.1"
VALUE "ProductVersion", "2024.08.25.00"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 3 additions & 3 deletions other/NSIS/nsis-build-x64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
!define LNK_NAME "TcNo Account Switcher.lnk"
!define COMP_NAME "TechNobo (Wesley Pyburn)"
!define WEB_SITE "https://tcno.co"
!define VERSION "4.0.0.0"
!define VERSION "2024.08.25.00"
!define COPYRIGHT "TechNobo (Wesley Pyburn) (C) 2021"
!define DESCRIPTION "TcNo Account Switcher"
!define LICENSE_TXT "..\..\LICENSE"
Expand Down Expand Up @@ -140,7 +140,7 @@ Section "Main files" InstSec
;Create uninstaller
WriteUninstaller "$INSTDIR\${UNINSTALL_EXE}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "TcNo Account Switcher"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "4"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$INSTDIR\${UNINSTALL_EXE}"
WriteRegStr HKLM "${UNINST_KEY}" "InstallLocation" "$INSTDIR"
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${COMP_NAME}"
Expand Down Expand Up @@ -200,4 +200,4 @@ Section "Uninstall"
DeleteRegKey HKLM "${UNINST_KEY}"
;Remove Protocol entry
DeleteRegKey HKCR "tcno"
SectionEnd
SectionEnd
101 changes: 101 additions & 0 deletions updateversion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Define the paths to the NSIS script file and the Installer RC file

$dateVersion = Read-Host "Enter the date version number (format: YYYY-MM-DD_VV)"
$nsisVersion = $dateVersion -replace "-", "." -replace "_", "."
$rcVersion = $dateVersion -replace "-", "," -replace "_", ","

# -------------------------------
# Update the NSIS script file
# -------------------------------

$nsisFilePath = "other\NSIS\nsis-build-x64.nsi"
$nsisFileContent = Get-Content $nsisFilePath
$nsisReplacement = '!define VERSION "' + $nsisVersion + '"'
$nsisFileContent = $nsisFileContent -replace '^!define VERSION\s+".*"$', $nsisReplacement
$nsisFileContent | Set-Content $nsisFilePath

Write-Host "UPDATED NSIS"

# -------------------------------
# Update the Installer RC file
# -------------------------------

$rcFilePath = "Installer\Installer.rc"
$rcFileContent = Get-Content $rcFilePath

$rcProductVersionReplacement = ' PRODUCTVERSION ' + $rcVersion
$rcFileVersionReplacement = ' FILEVERSION ' + $rcVersion

$rcValueProductVersionReplacement = ' VALUE "ProductVersion", "' + $nsisVersion + '"'
$rcValueFileVersionReplacement = ' VALUE "FileVersion", "' + $nsisVersion + '"'

$rcFileContent = $rcFileContent -replace '^\s*PRODUCTVERSION\s+\d+,\d+,\d+,\d+', $rcProductVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*FILEVERSION\s+\d+,\d+,\d+,\d+', $rcFileVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*VALUE "ProductVersion",\s*"\d+\.\d+\.\d+\.\d+"', $rcValueProductVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*VALUE "FileVersion",\s*"\d+\.\d+\.\d+\.\d+"', $rcValueFileVersionReplacement

$rcFileContent | Set-Content $rcFilePath

Write-Host "UPDATED Installer.rc"

# -------------------------------
# Update the Wrapper RC file
# -------------------------------

$rcFilePath = "_Updater_Wrapper\_Wrapper.rc"
$rcFileContent = Get-Content $rcFilePath

$rcProductVersionReplacement = ' PRODUCTVERSION ' + $rcVersion
$rcFileVersionReplacement = ' FILEVERSION ' + $rcVersion

$rcValueProductVersionReplacement = ' VALUE "ProductVersion", "' + $nsisVersion + '"'
$rcValueFileVersionReplacement = ' VALUE "FileVersion", "' + $nsisVersion + '"'

$rcFileContent = $rcFileContent -replace '^\s*PRODUCTVERSION\s+\d+,\d+,\d+,\d+', $rcProductVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*FILEVERSION\s+\d+,\d+,\d+,\d+', $rcFileVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*VALUE "ProductVersion",\s*"\d+\.\d+\.\d+\.\d+"', $rcValueProductVersionReplacement
$rcFileContent = $rcFileContent -replace '^\s*VALUE "FileVersion",\s*"\d+\.\d+\.\d+\.\d+"', $rcValueFileVersionReplacement

$rcFileContent | Set-Content $rcFilePath

Write-Host "UPDATED Wrapper.rc"

# -------------------------------
# Update the TcNo-Acc-Switcher-Client.csproj file
# -------------------------------

$csprojFilePath = "TcNo-Acc-Switcher-Client\TcNo-Acc-Switcher-Client.csproj"
$csprojFileContent = Get-Content $csprojFilePath
$csprojVersionReplacement = '<Version>' + $nsisVersion + '</Version>'
$csprojFileContent = $csprojFileContent -replace '<Version>.*</Version>', $csprojVersionReplacement
$csprojVersionReplacement = '<AssemblyVersion>' + $nsisVersion + '</AssemblyVersion>'
$csprojFileContent = $csprojFileContent -replace '<AssemblyVersion>.*</AssemblyVersion>', $csprojVersionReplacement

$csprojFileContent | Set-Content $csprojFilePath

Write-Host "UPDATED TcNo-Acc-Switcher-Client.csproj"

# -------------------------------
# Update the TcNo-Acc-Switcher-Server.csproj file
# -------------------------------

$csprojFilePath = "TcNo-Acc-Switcher-Server\TcNo-Acc-Switcher-Server.csproj"

$csprojFileContent = Get-Content $csprojFilePath
$csprojVersionReplacement = '<Version>' + $nsisVersion + '</Version>'
$csprojFileContent = $csprojFileContent -replace '<Version>.*</Version>', $csprojVersionReplacement
$csprojFileContent | Set-Content $csprojFilePath

Write-Host "UPDATED TcNo-Acc-Switcher-Server.csproj"

# -------------------------------
# Update the Globals.cs file
# -------------------------------

$globalsFilePath = "TcNo-Acc-Switcher-Globals\Globals.cs"
$globalsFileContent = Get-Content $globalsFilePath
$globalsVersionReplacement = 'public static readonly string Version = "' + $dateVersion + '";'
$globalsFileContent = $globalsFileContent -replace 'public static readonly string Version\s*=\s*".*";', $globalsVersionReplacement
$globalsFileContent | Set-Content $globalsFilePath

Write-Host "UPDATED Globals.cs"

0 comments on commit f3ed313

Please sign in to comment.