Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
windows:10:app_entwicklung [2024/01/07 21:01] – psycore | windows:10:app_entwicklung [2024/01/12 12:25] (aktuell) – gelöscht psycore | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | {{page> | ||
- | ====== App Entwicklung unter Windows 10 ====== | ||
- | Der Ausführliche MSDN Artikel ist [[https:// | ||
- | |||
- | ===== Dateien vorbereiten ===== | ||
- | |||
- | Alle benötigten Dateien werden in einen seperaten Ordner gelegt. Anschließend wird eine AppxManifest.xml Datei erzeugt: | ||
- | |||
- | <code xml> | ||
- | <?xml version=" | ||
- | <Package xmlns=" | ||
- | < | ||
- | Version=" | ||
- | Publisher=" | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | < | ||
- | < | ||
- | | ||
- | | ||
- | < | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | ===== App Bundle erzeugen ===== | ||
- | |||
- | <code dos> | ||
- | cd x: | ||
- | makeappx pack /d " | ||
- | </ | ||
- | |||
- | ===== Entwicklerlizenz beantragen ===== | ||
- | |||
- | Möglicherweise muss eine Entwicklerlizenz ((http:// | ||
- | |||
- | <code powershell> | ||
- | Show-WindowsDeveloperLicenseRegistration | ||
- | </ | ||
- | |||
- | ===== Entwicklerzertifikat erstellen ===== | ||
- | |||
- | OpenSSL für Windows installieren und folgende Befehle eingeben: ((https:// | ||
- | |||
- | <code dos> | ||
- | cd C: | ||
- | set openssl_conf=C: | ||
- | 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 " | ||
- | </ | ||
- | |||
- | Das Passwort sollte eingegeben werden, da es sonst zu Fehlern kommen kann. | ||
- | |||
- | ==== Zertifikat mit Kette ==== | ||
- | |||
- | ((http:// | ||
- | |||
- | 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 | ||
- | </ | ||
- | (^ = allow batch command-line to wrap line) | ||
- | |||
- | This creates a self-signed (-r) certificate, | ||
- | |||
- | 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' | ||
- | <code dos> | ||
- | certutil -user -addstore Root MyCA.cer | ||
- | </ | ||
- | 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 | ||
- | </ | ||
- | 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 | ||
- | </ | ||
- | 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:// | ||
- | </ | ||
- | (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 " | ||
- | /t http:// | ||
- | </ | ||
- | Some possible timestamp URLs for signtool /t are: | ||
- | |||
- | <code text> | ||
- | http:// | ||
- | http:// | ||
- | http:// | ||
- | </ | ||
- | |||
- | ===== Paket signieren ===== | ||
- | |||
- | Das Paket muss mit dem Signtool signiert werden. | ||
- | |||
- | <code dos> | ||
- | cd x: | ||
- | signtool sign /a /v /fd SHA256 /f x: | ||
- | </ | ||
- | |||
- | ===== App Installieren ===== | ||
- | |||
- | <code powershell> | ||
- | Add-AppxPackage x: | ||
- | </ |