1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00
rufus/_pre-commit.sh
Pete Batard e4372a9f57
[appstore] don't exit on unhandled parameters
* Looks like executables installed from the Windows Store launch with a "/InvokerPRAID"
  added parameter, which of course BREAKS apps that have a defined set of parameters
  and don't except that Microsoft would gingerly add random unwanted stuff there...
* The provision of this extra parameter also appears to be tied to using one of:
  - <TargetDeviceFamily Name="Windows.Universal" ...>
  - <uap:SplashScreen ...>
  - <Application EntryPoint="$targetentrypoint$" ...>
  in the appxmanifest.
* This resulted in our argument processing loop to cause early exit on account that an
  unexpected option was provided.
* Fix this by adding an explicit check for /InvokerPRAID and not exiting on unhandled
  params and removing or altering the 3 appxmanifest options listed above.
* Also set an explicit Windows.FullTrustApplication and remove splash screen.
* Also update _pre-commit.sh to update appstore build number automatically.
* Also remove splash screen images, add store listing CSV and toggle App builds to manual.
* Closes #1690
2021-02-05 17:47:48 +00:00

46 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
#
# Bumps the micro version according to the number of commits on this branch
#
# To have git run this script on commit, create a "pre-commit" text file in
# .git/hooks/ with the following content:
# #!/bin/sh
# if [ -x ./_pre-commit.sh ]; then
# . ./_pre-commit.sh
# fi
type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }
if [ -x ./_detect-amend.sh ]; then
. ./_detect-amend.sh
fi
BUILD=`git rev-list HEAD --count`
# adjust so that we match the github commit count
((BUILD++))
# there may be a better way to prevent improper micro on amend. For now the detection
# of a .amend file in the current directory will do
if [ -f ./.amend ]; then
((BUILD--))
rm ./.amend;
fi
echo "setting micro to $BUILD"
cat > cmd.sed <<\_EOF
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@BUILD@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@BUILD@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@BUILD@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@BUILD@@.\4"\5/
_EOF
# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@BUILD@@/$BUILD/g" cmd.sed
# Run sed to update the nano version
sed -b -i -f cmd.sed src/rufus.rc
sed -b -i -f cmd.sed res/appstore/Package.appxmanifest
# NB: we need to run git add else the modified files may be ignored
git add src/rufus.rc
git add res/appstore/Package.appxmanifest
rm cmd.sed