windows:10:app_entwicklung

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte ÜberarbeitungBeide Seiten der Revision
windows:10:app_entwicklung [2016/08/31 16:10] psycorewindows:10:app_entwicklung [2024/01/07 22:01] psycore
Zeile 1: Zeile 1:
 +{{page>vorlagen:pruefen}}
 +====== App Entwicklung unter Windows 10 ======
  
 +Der Ausführliche MSDN Artikel ist [[https://msdn.microsoft.com/en-us/library/windows/desktop/hh446767(v=vs.85).aspx#create_package_using_dir|hier zu finden]].
 +
 +===== Dateien vorbereiten =====
 +
 +Alle benötigten Dateien werden in einen seperaten Ordner gelegt. Anschließend wird eine AppxManifest.xml Datei erzeugt:
 +
 +<code xml>
 +<?xml version="1.0" encoding="utf-8"?>
 +<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
 +<Identity Name="MyCompany.MySuite.MyApp" 
 +          Version="1.0.0.0" 
 +          Publisher="CN=MyCompany, O=MyCompany, L=MyCity, S=MyState, C=MyCountry">
 +  <Properties>
 +    <DisplayName>MyApp</DisplayName>
 +    <PublisherDisplayName>MyCompany</PublisherDisplayName>
 +    <Logo>images\icon.png</Logo>
 +  </Properties>
 +  <Prerequisites>
 +    <OSMinVersion>6.2.1</OSMinVersion>
 +    <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
 +  </Prerequisites>
 +  <Resources>
 +    <Resource Language="de-de" />
 +  </Resources>
 + <Applications>
 +  <Application Id="MyApp" StartPage="default.html">
 +    <VisualElements DisplayName="My App" Description="A useful description." 
 +         Logo="images\icon.png" SmallLogo="images\small_icon.png" 
 +         ForegroundText="dark" BackgroundColor="#FFFFFF" >
 +      <SplashScreen Image="images\splash.png" />
 +    </VisualElements>
 +  </Application>
 +</Applications>
 +</Package>
 +</code>
 +
 +===== App Bundle erzeugen =====
 +
 +<code dos>
 +cd x:\Path\to\Win\Res\Kit\bin\x64
 +makeappx pack /d "x:\path\to\app" /p "x:\path\to\output.appx"
 +</code>
 +
 +===== Entwicklerlizenz beantragen =====
 +
 +Möglicherweise muss eine Entwicklerlizenz ((http://praxistipps.chip.de/windows-8-apps-ohne-windows-store-installieren_20489)) beantragt werden
 +
 +<code powershell>
 +Show-WindowsDeveloperLicenseRegistration
 +</code>
 +
 +===== Entwicklerzertifikat erstellen =====
 +
 +OpenSSL für Windows installieren und folgende Befehle eingeben: ((https://www.soft-ware.net/tipps/tipp67/Digitale-Signatur-erstellen-pfx-Datei.asp))
 +
 +<code dos>
 +cd C:\OpenSSL-Win32\bin
 +set openssl_conf=C:\OpenSSL-Win32\bin\openssl.cfg
 +openssl req -x509 -nodes -days 730 -newkey rsa:1024 -keyout meinzertifikat.pem -out meinzertifikat.pem
 +openssl pkcs12 -export -out meinzertifikat.pfx -in meinzertifikat.pem -name "Windows Apps Test"
 +</code>
 +
 +Das Passwort sollte eingegeben werden, da es sonst zu Fehlern kommen kann.
 +
 +==== Zertifikat mit Kette ====
 +
 +((http://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows))
 +
 +While you can create a self-signed code-signing certificate (SPC - Software Publisher Certificate) in one go, I prefer to do the following:
 +Creating a self-signed certificate authority (CA)
 +<code dos>
 +makecert -r -pe -n "CN=My CA" -ss CA -sr CurrentUser ^
 +         -a sha256 -cy authority -sky signature -sv MyCA.pvk MyCA.cer
 +</code>
 +(^ = allow batch command-line to wrap line)
 +
 +This creates a self-signed (-r) certificate, with an exportable private key (-pe). It's named "My CA", and should be put in the CA store for the current user. We're using the SHA-256 algorithm. The key is meant for signing (-sky).
 +
 +The private key should be stored in the MyCA.pvk file, and the certificate in the MyCA.cer file.
 +Importing the CA certificate
 +
 +Because there's no point in having a CA certificate if you don't trust it, you'll need to import it into the Windows certificate store. You can use the Certificates MMC snapin, but from the command line:
 +<code dos>
 +certutil -user -addstore Root MyCA.cer
 +</code>
 +Creating a code-signing certificate (SPC)
 +
 +<code dos>
 +makecert -pe -n "CN=My SPC" -a sha256 -cy end ^
 +         -sky signature ^
 +         -ic MyCA.cer -iv MyCA.pvk ^
 +         -sv MySPC.pvk MySPC.cer
 +</code>
 +It is pretty much the same as above, but we're providing an issuer key and certificate (the -ic and -iv switches).
 +
 +We'll also want to convert the certificate and key into a PFX file:
 +<code dos>
 +pvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfx
 +</code>
 +If you want to protect the PFX file, add the -po switch, otherwise PVK2PFX creates a PFX file with no passphrase.
 +Using the certificate for signing code
 +<code dos>
 +signtool sign /v /f MySPC.pfx MyExecutable.exe
 +              /t http://timestamp.url MyExecutable.exe
 +</code>
 +(See why timestamps may matter)
 +
 +If you import the PFX file into the certificate store (you can use PVKIMPRT or the MMC snapin), you can sign code as follows:
 +<code dos>
 +signtool sign /v /n "Me" /s SPC /d http://www.me.me ^
 +              /t http://timestamp.url MyExecutable.exe
 +</code>
 +Some possible timestamp URLs for signtool /t are:
 +
 +<code text>
 +    http://timestamp.verisign.com/scripts/timstamp.dll
 +    http://timestamp.globalsign.com/scripts/timstamp.dll
 +    http://timestamp.comodoca.com/authenticode
 +</code>
 +
 +===== Paket signieren =====
 +
 +Das Paket muss mit dem Signtool signiert werden.
 +
 +<code dos>
 +cd x:\Path\to\Win\Res\Kit\bin\x64
 +signtool sign /a /v /fd SHA256 /f x:\path\to\cert.pfx /p PASSWORD x:\path\to\app.appx
 +</code>
 +
 +===== App Installieren =====
 +
 +<code powershell>
 +Add-AppxPackage x:\path\to\app.appx
 +</code>