1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[misc] add build data for Windows Apps Store

* Rather useless, since elevated apps are neither accepted by Microsoft nor
  will they run by default when sideloaded. But, hey, I can has apps!
* Also update sign and sed scripts
This commit is contained in:
Pete Batard 2017-04-20 12:58:04 +01:00
parent aec2736245
commit 3924d2847d
10 changed files with 103 additions and 26 deletions

View file

@ -22,16 +22,17 @@ esac
echo "changing version to $MAJOR.$MINOR"
sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR]\2/" configure.ac
cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*.*,.*,\(.*\),\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,\1,\2/
s/^[ \t]*PRODUCTVERSION[ \t]*.*,.*,\(.*\),\(.*\)/ PRODUCTVERSION @@MAJOR@@,@@MINOR@@,\1,\2/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*".*\..*\.\(.*\)"/\1VALUE "FileVersion", "@@MAJOR@@.@@MINOR@@.\2"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*".*\..*\.\(.*\)"/\1VALUE "ProductVersion", "@@MAJOR@@.@@MINOR@@.\2"/
s/^\(.*\)"Rufus .*\..*\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.\2"\3/
s/^\([ \t]*\)\(FILE\|PRODUCT\)VERSION\([ \t]*\)[0-9]*,[0-9]*\(.*\)/\1\2VERSION\3@@MAJOR@@,@@MINOR@@\4/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"[0-9]*\.[0-9]*\.\(.*\)/\1VALUE\2"\3Version",\4"@@MAJOR@@.@@MINOR@@.\5/
s/^\(.*\)"Rufus [0-9]*\.[0-9]*\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.\2"\3/
s/^\([ \t]*\)Version="[0-9]*\.[0-9]*\.\(.*\)"\(.*\)/\1Version="@@MAJOR@@.@@MINOR@@.\2"\3/
s/^set VERSION=[0-9]*\.[0-9]*/set VERSION=@@MAJOR@@.@@MINOR@@/
_EOF
# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" cmd.sed
sed -i -f cmd.sed src/rufus.rc
sed -i 's/$/\r/' src/rufus.rc
sed -b -i -f cmd.sed src/rufus.rc
sed -b -i -f cmd.sed res/appstore/AppxManifest.xml
sed -b -i -f cmd.sed res/appstore/packme.cmd
rm cmd.sed
source ./bootstrap.sh

View file

@ -26,20 +26,16 @@ echo "setting micro to $TAGVER"
echo $TAGVER > .tag
cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),.*,\(.*\)/ FILEVERSION \1,\2,@@TAGVER@@,\3/
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),.*,\(.*\)/ PRODUCTVERSION \1,\2,@@TAGVER@@,\3/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*"\(.*\)\..*"/\1VALUE "FileVersion", "\2.@@TAGVER@@"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*"\(.*\)\..*"/\1VALUE "ProductVersion", "\2.@@TAGVER@@"/
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@TAGVER@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@TAGVER@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@TAGVER@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/
_EOF
# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
# Run sed to update the nano version
sed -i -f cmd.sed src/rufus.rc
# MinGW's sed has the bad habit of eating CRLFs - make sure we keep 'em
sed -i 's/$/\r/' src/rufus.rc
sed -b -i -f cmd.sed src/rufus.rc
# NB: we need to run git add else the modified files may be ignored
git add src/rufus.rc

View file

@ -3,3 +3,12 @@ rm -f rufus*.exe
./configure --disable-debug "$@"
make -j12 clean
make -j12 release
# Update AppxManifest.xml with the build number
TAGVER=`git log --oneline | wc -l`
cat > cmd.sed <<\_EOF
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/
_EOF
sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
sed -b -i -f cmd.sed res/appstore/AppxManifest.xml
rm cmd.sed

View file

@ -1,8 +1,4 @@
@echo off
:retry_sha1
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool" sign /v /sha1 655f6413a8f721e3286ace95025c9e0ea132a984 /fd SHA1 /tr http://timestamp.comodoca.com/rfc3161 /td SHA1 %1
if ERRORLEVEL 1 goto retry_sha1
:retry_sha256
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool" sign /as /v /sha1 5759b23dc8f45e9120a7317f306e5b6890b612f0 /fd SHA256 /tr http://timestamp.comodoca.com/rfc3161 /td SHA256 %1
if ERRORLEVEL 1 goto retry_sha256
"C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool" sign /v /sha1 655f6413a8f721e3286ace95025c9e0ea132a984 /fd SHA1 /tr http://timestamp.comodoca.com/rfc3161 /td SHA1 %1
"C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool" sign /as /v /sha1 5759b23dc8f45e9120a7317f306e5b6890b612f0 /fd SHA256 /tr http://timestamp.comodoca.com/rfc3161 /td SHA256 %1
exit

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<!-- NB: If you're signing with Authenticode, then the Publisher *MUST* match the LDAP fields from the
signature certificate exactly, else SignTool will fail with error 0x8007000b. Note that this makes
for an interesting struggle, when you also happen to have a comma in one of the fields... -->
<Identity
Name="Rufus"
Version="2.15.1091.0"
ProcessorArchitecture="x86"
Publisher='CN=Akeo Consulting, O=Akeo Consulting, STREET="24, Grey Rock", L=Milford, S=Co Donegal, PostalCode=Co Donegal, C=IE' />
<Properties>
<DisplayName>Rufus</DisplayName>
<PublisherDisplayName>Akeo Consulting</PublisherDisplayName>
<Description>Rufus</Description>
<Logo>Assets\Rufus-48.png</Logo>
</Properties>
<Resources>
<Resource Language="en-US" />
</Resources>
<Dependencies>
<TargetDeviceFamily
Name="Windows.Desktop"
MinVersion="10.0.14316.0"
MaxVersionTested="10.0.15063.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application
Id="Rufus"
Executable="rufus.exe"
EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
BackgroundColor="transparent"
DisplayName="Rufus"
Square150x150Logo="Assets\Rufus-150.png"
Square44x44Logo="Assets\Rufus-44.png"
Description="Rufus">
<uap:DefaultTile>
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
</uap:VisualElements>
</Application>
</Applications>
</Package>

9
res/appstore/README.txt Normal file
View file

@ -0,0 +1,9 @@
This directory contains the resources to create a Windows Store package.
However, since Microsoft doesn't allow elevated applications into the Windows
Store, and, even if you install it manually, Windows 10 will also refuse to
elevate it (so you have to explicitly select to run it as admin *every time*),
this is rather pointless.
Still, you can find the latest signed application package at:
https://rufus.akeo.ie/testing/

15
res/appstore/packme.cmd Normal file
View file

@ -0,0 +1,15 @@
@echo off
set VERSION=2.15
echo [Files]>mappings.lst
echo "..\icon-set\rufus-44.png" "Assets\Rufus-44.png">>mappings.lst
echo "..\icon-set\rufus-48.png" "Assets\Rufus-48.png">>mappings.lst
echo "..\icon-set\rufus-150.png" "Assets\Rufus-150.png">>mappings.lst
echo "..\..\rufus-%VERSION%.exe" "rufus.exe">>mappings.lst
echo "AppxManifest.xml" "AppxManifest.xml">>mappings.lst
"C:\Program Files (x86)\Windows Kits\10\bin\x64\MakeAppx" pack /o /f mappings.lst /p Rufus-%VERSION%.appx
if ERRORLEVEL 1 goto out
"C:\Program Files (x86)\Windows Kits\10\bin\x64\SignTool" sign /v /sha1 5759b23dc8f45e9120a7317f306e5b6890b612f0 /fd SHA256 /tr http://timestamp.comodoca.com/rfc3161 /td SHA256 Rufus-%VERSION%.appx
:out
del mappings.lst
pause
exit

BIN
res/icon-set/rufus-150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
res/icon-set/rufus-44.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 2.15.1090"
CAPTION "Rufus 2.15.1091"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -334,8 +334,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,15,1090,0
PRODUCTVERSION 2,15,1090,0
FILEVERSION 2,15,1091,0
PRODUCTVERSION 2,15,1091,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -352,13 +352,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.15.1090"
VALUE "FileVersion", "2.15.1091"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2017 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.15.1090"
VALUE "ProductVersion", "2.15.1091"
END
END
BLOCK "VarFileInfo"