-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package NVDA for the Windows Store (#7851)
* Allow Building an appx package by running scons appx * appveyor should also build the appx package * Disable features that are incompatible with Windows Store policy * Restart on Windows store updates * Change publisher to match Windows store, and set appx version so minor is build and revision is 0 * Hardcode certain Windows Store publisher details, and don't sign the appx anymore (Windows Store does that). * Change back the publisher to NV Access in appveyor.yml. It is now hardcoded separately in the appx manifest for windows store. * scons appx now produces two appx files: * storeSubmition: not signed, and a publisher ID matching NV Access Limited's Store publisher ID. Suitable for submitting to the Windows Store via NV Access Limited's developer account * sideLoadable: signed by NV Access Limited, suitable for installing on a Windows 10 system manually as a side-loaded app for testing.
- Loading branch information
1 parent
8cfdfe2
commit 2571d54
Showing
15 changed files
with
228 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<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" | ||
> | ||
<Identity | ||
Name="%packageName%" | ||
Version="%packageVersion%" | ||
Publisher="%packagePublisher%" | ||
ProcessorArchitecture="x86" | ||
/> | ||
<Properties> | ||
<DisplayName>%productName%</DisplayName> | ||
<PublisherDisplayName>%publisher%</PublisherDisplayName> | ||
<Description>%description%</Description> | ||
<Logo>appx_images/nvda_44x44.png</Logo> | ||
</Properties> | ||
<Resources> | ||
<Resource Language="en" /> | ||
</Resources> | ||
<Dependencies> | ||
<TargetDeviceFamily | ||
Name="Windows.Desktop" | ||
MinVersion="10.0.15063.0" | ||
MaxVersionTested="10.0.16278.100" | ||
/> | ||
</Dependencies> | ||
<Capabilities> | ||
<rescap:Capability Name="runFullTrust"/> | ||
</Capabilities> | ||
<Applications> | ||
<Application | ||
Id="mainExecutable" | ||
Executable="nvda_noUIAccess.exe" | ||
EntryPoint="Windows.FullTrustApplication" | ||
> | ||
<uap:VisualElements | ||
DisplayName="%productName%" | ||
Description="%description%" | ||
Square150x150Logo="appx_images/nvda_150x150.png" | ||
Square44x44Logo="appx_images/nvda_44x44.png" | ||
BackgroundColor="#660099" | ||
/> | ||
</Application> | ||
</Applications> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import subprocess | ||
import versionInfo | ||
|
||
Import([ | ||
'env', | ||
'outFilePrefix', | ||
'isStoreSubmission', | ||
]) | ||
|
||
def getCertPublisher(env): | ||
""" | ||
If no signing certificate is provided, then the given publisher is used as is. | ||
If a signing certificate is given, then the publisher is extracted from the certificate. | ||
""" | ||
certFile=env.get('certFile') | ||
if not certFile: | ||
return env['publisher'] | ||
certPassword=env.get('certPassword','') | ||
cmd=['certutil','-dump','-p',certPassword,File('#'+certFile).abspath.replace('/','\\')] | ||
lines=subprocess.check_output(cmd).splitlines() | ||
linePrefix='Subject: ' | ||
for line in lines: | ||
if line.startswith(linePrefix): | ||
subject=line[len(linePrefix):].rstrip() | ||
return subject | ||
|
||
packageName="NVAccessLimited.NVDANonVisualDesktopAccess" | ||
packageVersion="%s.%s.%s.%s"%(versionInfo.version_year,versionInfo.version_major,env['version_build'],0) | ||
if isStoreSubmission: | ||
packageFileName=outFilePrefix+"_storeSubmission.appx" | ||
# NV Access Limited's Windows Store publisher ID | ||
# It is okay to be here as the only way to submit, validate and sign the package is via the NV Access store account. | ||
packagePublisher="CN=83B1DA31-9B66-442C-88AB-77B4B815E1DE" | ||
packagePublisherDisplayName="NV Access Limited" | ||
productName="NVDA Screen Reader (Windows Store Edition)" | ||
else: # not for submission, just side-loadable | ||
packageFileName=outFilePrefix+"_sideLoadable.appx" | ||
packagePublisher=getCertPublisher(env) | ||
packagePublisherDisplayName=env['publisher'] | ||
productName="NVDA Screen Reader (Windows Desktop Bridge Edition)" | ||
|
||
signExec=env['signExec'] if env['certFile'] else None | ||
|
||
# Files from NVDA's distribution that cannot be included in the appx due to policy or security restrictions | ||
excludedDistFiles=[ | ||
'nvda_eoaProxy.exe', | ||
'nvda_service.exe', | ||
'nvda_slave.exe', | ||
'nvda_uiAccess.exe', | ||
'lib/IAccessible2Proxy.dll', | ||
'lib/ISimpleDOM.dll', | ||
'lib/minHook.dll', | ||
'lib/NVDAHelperRemote.dll', | ||
'lib/VBufBackend_adobeAcrobat.dll', | ||
'lib/VBufBackend_adobeFlash.dll', | ||
'lib/VBufBackend_gecko_ia2.dll', | ||
'lib/VBufBackend_lotusNotesRichText.dll', | ||
'lib/VBufBackend_mshtml.dll', | ||
'lib/VBufBackend_webKit.dll', | ||
'lib64/', | ||
'uninstall.exe', | ||
] | ||
|
||
# Create an appx manifest with version and publisher etc all filled in | ||
manifest=env.Substfile( | ||
"AppxManifest.xml", | ||
'manifest.xml.subst', | ||
SUBST_DICT={ | ||
'%packageName%':packageName, | ||
'%packageVersion%':packageVersion, | ||
'%packagePublisher%':packagePublisher, | ||
'%publisher%':packagePublisherDisplayName, | ||
'%productName%':productName, | ||
'%description%':versionInfo.description, | ||
}, | ||
) | ||
# Make a copy of the dist dir produced by py2exe | ||
# And also place some extra appx specific images in there | ||
appxContent=env.Command( | ||
target='content', | ||
source=[Dir("#dist"),Dir('#appx/appx_images'),manifest], | ||
action=[ | ||
Delete("$TARGET"), | ||
Copy("$TARGET","${SOURCES[0]}"), | ||
Copy("${TARGET}\\appx_images","${SOURCES[1]}"), | ||
Copy("${TARGET}\\AppxManifest.xml","${SOURCES[2]}"), | ||
]+[Delete("${TARGET}/%s"%excludeFile) for excludeFile in excludedDistFiles], | ||
) | ||
# Ensure that it is always copied as we can't tell if dist changed | ||
env.AlwaysBuild(appxContent) | ||
# Package the appx | ||
appx=env.Command(packageFileName,appxContent,"makeappx pack /p $TARGET /d $SOURCE") | ||
if signExec and not isStoreSubmission: | ||
env.AddPostAction(appx,signExec) | ||
|
||
Return(['appx']) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.