mirror of
https://github.com/dreamforceinc/wUpdateVersionPS.git
synced 2026-03-28 10:42:46 +03:00
Initial commit
This commit is contained in:
441
.gitignore
vendored
Normal file
441
.gitignore
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Bb]uild/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
#*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Microsoft Azure ApplicationInsights config file
|
||||
ApplicationInsights.config
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
.*.swp
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
/windows/LightGBM.VC.db
|
||||
lightgbm
|
||||
|
||||
# Created by https://www.gitignore.io/api/python
|
||||
|
||||
### Python ###
|
||||
!/python-package/lightgbm/
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
#*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
.hypothesis/
|
||||
**/coverage.html
|
||||
**/coverage.html.zip
|
||||
R-package/tests/testthat/Rplots.pdf
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
docs/pythonapi/
|
||||
|
||||
# Doxygen documentation
|
||||
docs/doxyoutput/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# dotenv
|
||||
.env
|
||||
|
||||
# virtualenv
|
||||
.venv/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# R testing artefact
|
||||
lightgbm.model
|
||||
|
||||
# saved or dumped model/data
|
||||
*.model
|
||||
*.pkl
|
||||
*.bin
|
||||
|
||||
# macOS
|
||||
**/.DS_Store
|
||||
|
||||
# VSCode
|
||||
.vscode
|
||||
|
||||
# IntelliJ IDEA
|
||||
.idea/
|
||||
|
||||
# Files from local Python install
|
||||
python-package/LICENSE
|
||||
python-package/build_cpp/
|
||||
python-package/compile/
|
||||
python-package/lightgbm/VERSION.txt
|
||||
|
||||
# R build artefacts
|
||||
R-package/src/CMakeLists.txt
|
||||
R-package/src/lib_lightgbm.so.dSYM/
|
||||
R-package/src/src/
|
||||
lightgbm_r/*
|
||||
lightgbm*.tar.gz
|
||||
lightgbm.Rcheck/
|
||||
|
||||
# Files from interactive R sessions
|
||||
.Rproj.user
|
||||
**/.Rhistory
|
||||
|
||||
# Files generated by aspell
|
||||
**/*.bak
|
||||
|
||||
# GraphViz artifacts
|
||||
*.gv
|
||||
*.gv.*
|
||||
|
||||
[Pp]atches/
|
||||
*.patch
|
||||
118
README.md
Normal file
118
README.md
Normal file
@@ -0,0 +1,118 @@
|
||||
# wUpdateVersionPS
|
||||
|
||||
Ñêðèïò PowerShell äëÿ àâòîìàòè÷åñêîãî îáíîâëåíèÿ íîìåðà âåðñèè ïðîãðàììû.
|
||||
|
||||
_**Ôàéë ðåñóðñîâ äîëæåí áûòü â ANSI èëè UTF-8 êîäèðîâêå.**_
|
||||
|
||||
|
||||
## Íàçíà÷åíèå ñêðèïòà ##
|
||||
`wUpdateVersionPS` ñëóæèò äëÿ àâòîìàòè÷åñêîãî îáíîâëåíèÿ âåðñèè ïðîãðàììû ïåðåä ýòàïîì êîìïèëÿöèè â ñðåäå ðàçðàáîòêè Microsoft Visual Studio. Ñêðèïò èçâëåêàåò çíà÷åíèå âåðñèè èç ôàéëà, ñîäåðæàùåãî ìàêðîñ èëè îïðåäåëåíèå `APP_VERSION`, è çàïèñûâàåò ýòó âåðñèþ â áëîê `VERSIONINFO` ôàéëà ðåñóðñîâ.
|
||||
|
||||
## ×òî äåëàåò ñêðèïò? ##
|
||||
|
||||
1. Èçâëåêàåò âåðñèþ ïðîãðàììû èç çàäàííîãî ôàéëà (*íàïðèìåð `version.h`*), ñîäåðæàùåãî ñòðîêó âèäà `#define APP_VERSION "X.Y.Z.W"`.
|
||||
|
||||
2. Îáíîâëÿåò â óêàçàííîì ôàéëå ðåñóðñîâ (*íàïðèìåð `resources.rc`*) áëîê `VERSIONINFO`, ñîäåðæàùèé ñòðîêè `FileVersion` è `ProductVersion`, ñîîòâåòñòâåííî.
|
||||
|
||||
## Êàê çàïóñòèòü ñêðèïò? ##
|
||||
|
||||
Çàïóñêàéòå ñêðèïò êîìàíäîé â êîíñîëè PowerShell:
|
||||
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File path\to\wUpdateVersionPS.ps1 arg1 arg2
|
||||
```
|
||||
Ïàðàìåòðû:
|
||||
|
||||
`path\to\wUpdateVersionPS.ps1`: Ïîëíûé ïóòü ê PowerShell-ñêðèïòó.
|
||||
|
||||
`arg1`: Ïóòü ê ôàéëó, ñîäåðæàùåìó îïðåäåëåíèå âåðñèè (`version.h`).
|
||||
|
||||
`arg2`: Ïóòü ê ôàéëó ðåñóðñîâ (`resources.rc`).
|
||||
|
||||
Íàïðèìåð:
|
||||
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File C:\Scripts\wUpdateVersionPS.ps1 C:\Project\version.h C:\Project\resources.rc
|
||||
```
|
||||
|
||||
## Àâòîìàòèçàöèÿ çàïóñêà ñêðèïòà ïåðåä ñáîðêîé ïðîåêòà ##
|
||||
|
||||
Âû ìîæåòå äîáàâèòü âûçîâ ñêðèïòà â êà÷åñòâå ïðåäêîìïèëÿöèîííîãî øàãà â ïðîåêòå Microsoft Visual Studio, âûïîëíèâ ñëåäóþùèå øàãè:
|
||||
|
||||
1. Ù¸ëêíèòå ïðàâîé êíîïêîé ìûøè ïî ïðîåêòó â Solution Explorer è âûáåðèòå ïóíêò Properties.
|
||||
|
||||
2. Ïåðåéäèòå íà âêëàäêó Build Events, ðàçäåë Pre-Build Event, Command Line.
|
||||
|
||||
3. Äîáàâüòå òóäà ñëåäóþùèé êîä:
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)wUpdateVersionPS.ps1" "$(ProjectDir)version.h" "$(ProjectDir)resources.rc"
|
||||
```
|
||||
> *Â äàííîì ïðèìåðå ñêðèïò `wUpdateVersionPS.ps1` íàõîäèòñÿ â ïàïêå ðåøåíèÿ, à ôàéëû `version.h` è `resources.rc` - â ïàïêå ïðîåêòà.*
|
||||
|
||||
4. Îáíîâèòå îïðåäåëåíèå ìàêðîñà `APP_VERSION` â ôàéëå `version.h` (Íàïðèìåð `APP_VERSION "1.0"` -> `APP_VERSION "1.1"`).
|
||||
|
||||
Òàêèì îáðàçîì, êàæäûé ðàç ïåðåä êîìïèëÿöèåé ïðîåêòà âåðñèÿ ïðîãðàììû áóäåò àâòîìàòè÷åñêè îáíîâëÿòüñÿ.
|
||||
|
||||
_(c) 2026 Vladislav Salikov aka W0LF aka 'dreamforce'_
|
||||
|
||||
> _Ýòîò òåêñò ñîçäàí ñ ïîìîùüþ Giga.Chat._
|
||||
-----
|
||||
|
||||
|
||||
# wUpdateVersionPS
|
||||
|
||||
A PowerShell script for automatically updating the program version number.
|
||||
|
||||
_**The resource file must be in ANSI or UTF-8 encoding.**_
|
||||
|
||||
## Script Purpose ##
|
||||
`wUpdateVersionPS` is used to automatically update the program version before compilation in the Microsoft Visual Studio IDE. The script extracts the version value from a file containing the `APP_VERSION` macro or definition and writes this version to the `VERSIONINFO` block of the resource file.
|
||||
|
||||
## What does the script do? ##
|
||||
|
||||
1. Extracts the program version from the specified file (*e.g. `version.h`*) containing the string `#define APP_VERSION "X.Y.Z.W"`.
|
||||
|
||||
2. Updates the `VERSIONINFO` block in the specified resource file (*e.g. `resources.rc`*) containing the strings `FileVersion` and `ProductVersion`, respectively.
|
||||
|
||||
## How do I run the script? ##
|
||||
|
||||
Run the script with the following command in the PowerShell console:
|
||||
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File path\to\wUpdateVersionPS.ps1 arg1 arg2
|
||||
```
|
||||
Parameters:
|
||||
|
||||
`path\to\wUpdateVersionPS.ps1`: Full path to the PowerShell script.
|
||||
|
||||
`arg1`: Path to the file containing the version definition (`version.h`).
|
||||
|
||||
`arg2`: Path to the resource file (`resources.rc`).
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File C:\Scripts\wUpdateVersionPS.ps1 C:\Project\version.h C:\Project\resources.rc
|
||||
```
|
||||
|
||||
## Automating the execution of a script before building a project ##
|
||||
|
||||
You can add a script call as a pre-compile step in a Microsoft Visual Studio IDE by following these steps:
|
||||
|
||||
1. Right-click the project in Solution Explorer and select Properties.
|
||||
|
||||
2. Go to the Build Events tab, Pre-Build Event section, Command Line.
|
||||
|
||||
3. Add the following code there:
|
||||
```bash
|
||||
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)wUpdateVersionPS.ps1" "$(ProjectDir)version.h" "$(ProjectDir)resources.rc"
|
||||
```
|
||||
> *In this example, the `wUpdateVersionPS.ps1` script is located in the solution folder, and the `version.h` and `resources.rc` files are in the project folder.*
|
||||
|
||||
4. Update the definition of the `APP_VERSION` macro in the `version.h` file (e.g. `APP_VERSION "1.0"` -> `APP_VERSION "1.1"`).
|
||||
|
||||
This way, the program version will be automatically updated every time the project is compiled.
|
||||
|
||||
_(c) 2026 Vladislav Salikov aka W0LF aka 'dreamforce'_
|
||||
|
||||
> _This text was created using Giga.Chat._
|
||||
16
testversion.h
Normal file
16
testversion.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// version.h
|
||||
#pragma once
|
||||
|
||||
#define APP_VERSION "0.1"
|
||||
|
||||
#ifdef _WIN64
|
||||
#define APP_ARCH "x64"
|
||||
#else
|
||||
#define APP_ARCH "x86"
|
||||
#endif // _WIN64
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define APP_CONF "d"
|
||||
#else
|
||||
#define APP_CONF ""
|
||||
#endif // _DEBUG
|
||||
135
testversion.rc
Normal file
135
testversion.rc
Normal file
@@ -0,0 +1,135 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "Resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_MYAPP ICON "my_app.ico"
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 163
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 55
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"Resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "My Company"
|
||||
VALUE "FileDescription", "Application description"
|
||||
VALUE "FileVersion", "1.0"
|
||||
VALUE "InternalName", "my_app"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2026"
|
||||
VALUE "OriginalFilename", "my_app.exe"
|
||||
VALUE "ProductName", "My Supa App"
|
||||
VALUE "ProductVersion", "1.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 0x4B0
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "My Supa App"
|
||||
IDC_MYAPP "MYAPPCLASS"
|
||||
END
|
||||
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
49
wUpdateVersions.ps1
Normal file
49
wUpdateVersions.ps1
Normal file
@@ -0,0 +1,49 @@
|
||||
# wUpdateVersion v0.1
|
||||
# Copyright (c) 2026 Vladislav Salikov aka W0LF aka 'dreamforce'
|
||||
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter (Position = 1)]
|
||||
[string]$VersionFile = $(throw "ERROR!!! Required parameter 'VersionFile' is missing!"),
|
||||
|
||||
[Parameter (Position = 2)]
|
||||
[string]$ResourceFile = $(throw "ERROR!!! Required parameter 'ResourceFile' is missing!")
|
||||
)
|
||||
|
||||
$date = Get-Date
|
||||
$buildDateTime = "Build date: $($date.GetDateTimeFormats('u').Replace('Z', ''))"
|
||||
$logString = "Starting wUpdateVersion script..." > .\wUpdateVersion.log
|
||||
$logString = $buildDateTime >> .\wUpdateVersion.log
|
||||
$newVersionStr = "0"
|
||||
$newVersionNum = "0"
|
||||
$content = ""
|
||||
|
||||
if ( Test-Path -Path $VersionFile ) {
|
||||
$content = Select-String -Path $VersionFile -Pattern 'APP_VERSION' -SimpleMatch | Select-Object -ExpandProperty Line
|
||||
$newVersionStr = $content.Split()[-1].Trim('"')
|
||||
$newVersionNum = $newVersionStr.Replace('.', ',')
|
||||
}
|
||||
else {
|
||||
$logString = "Can't open file '$($VersionFile)'" >> .\wUpdateVersion.log
|
||||
Write-Host "Can't open file '$($VersionFile)'"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ( Test-Path -Path $ResourceFile ) {
|
||||
$ResourceFileBak = $ResourceFile + '.bak'
|
||||
if (Test-Path -Path $ResourceFileBak) {
|
||||
Remove-Item -Path $ResourceFileBak
|
||||
}
|
||||
Rename-Item -Path $ResourceFile -NewName $ResourceFileBak
|
||||
Get-Content -Path $ResourceFileBak -Encoding UTF8 `
|
||||
| % { $_ -replace '"(FileVersion|ProductVersion)",\s*"?[\d\.]+"?', "`"`$1`", `"$newVersionStr`"" -replace '(FileVersion|ProductVersion)\s*[\d\,]+', "`$1 $newVersionNum" } <# MAGIC !!! #> `
|
||||
| Set-Content $ResourceFile -Encoding UTF8
|
||||
}
|
||||
else {
|
||||
$logString = "Can't open file '$($ResourceFile)'" >> .\wUpdateVersion.log
|
||||
Write-Host "Can't open file '$($ResourceFile)'"
|
||||
exit 2
|
||||
}
|
||||
|
||||
$logString = "End of wUpdateVersion script." >> .\wUpdateVersion.log
|
||||
exit 0
|
||||
Reference in New Issue
Block a user