Skip to content

Commit

Permalink
[appstore] prevent packaging of ALPHA or BETA versions
Browse files Browse the repository at this point in the history
* Also add package version override
  • Loading branch information
pbatard committed Jan 18, 2024
1 parent b63f9ae commit f6fd520
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 15 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,18 @@ jobs:
shell: bash
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
run: echo "option=--enable-alpha" >> $GITHUB_OUTPUT
run: |
echo "option=--enable-alpha" >> $GITHUB_OUTPUT
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (ALPHA)"/' ./src/rufus.rc
- name: Set BETA
id: set_beta
shell: bash
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }}
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
run: echo "option=--enable-beta" >> $GITHUB_OUTPUT
run: |
echo "option=--enable-beta" >> $GITHUB_OUTPUT
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (BETA)"/' ./src/rufus.rc
- name: Build
run: |
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/vs2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,18 @@ jobs:
shell: bash
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
run: echo "option=/DALPHA" >> $GITHUB_OUTPUT
run: |
echo "option=/DALPHA" >> $GITHUB_OUTPUT
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (ALPHA)"/' ./src/rufus.rc
- name: Set BETA
id: set_beta
shell: bash
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }}
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
run: echo "option=/DBETA" >> $GITHUB_OUTPUT
run: |
echo "option=/DBETA" >> $GITHUB_OUTPUT
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (BETA)"/' ./src/rufus.rc
- name: Build
shell: cmd
Expand Down
35 changes: 29 additions & 6 deletions res/appstore/packme.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
@echo off
setlocal EnableExtensions DisableDelayedExpansion

rem if set, this will override the version for the package
rem set VERSION_OVERRIDE=4.4.2104.0

goto main

:ReplaceTokenInFile
Expand Down Expand Up @@ -66,13 +69,33 @@ for %%a in (%ARCHS%) do (
)
)

rem exiftool.exe can't be installed in the Windows system directories...
if not exist exiftool.exe (
echo exiftool.exe must exist in this directory
goto out
)

rem Make sure we're not trying to create a package from an ALPHA or BETA version!
exiftool -s3 -*InternalName* rufus_x64.exe | findstr /C:"ALPHA" 1>nul && (
echo Alpha version detected - ABORTED
goto out
)
exiftool -s3 -*InternalName* rufus_x64.exe | findstr /C:"BETA" 1>nul && (
echo Beta version detected - ABORTED
goto out
)

rem Populate the version from the executable
set target=%~dp0rufus_x64.exe
set target=%target:\=\\%
wmic datafile where "name='%target%'" get version | find /v "Version" > version.txt
set /p VERSION=<version.txt
set VERSION=%VERSION: =%
del version.txt
setlocal EnableDelayedExpansion
if "%VERSION_OVERRIDE%"=="" (
exiftool -s3 -*FileVersionNumber* rufus_x64.exe > version.txt
set /p VERSION=<version.txt
del version.txt
)else (
echo WARNING: Forcing version to %VERSION_OVERRIDE%
set VERSION=%VERSION_OVERRIDE%
)
setlocal DisableDelayedExpansion

echo Will create %VERSION% AppStore Bundle
pause
Expand Down
10 changes: 5 additions & 5 deletions src/rufus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 4.4.2103"
CAPTION "Rufus 4.4.2104"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
Expand Down Expand Up @@ -392,8 +392,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,4,2103,0
PRODUCTVERSION 4,4,2103,0
FILEVERSION 4,4,2104,0
PRODUCTVERSION 4,4,2104,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -411,13 +411,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "4.4.2103"
VALUE "FileVersion", "4.4.2104"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-4.4.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "4.4.2103"
VALUE "ProductVersion", "4.4.2104"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit f6fd520

Please sign in to comment.