compile_powershell
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| compile_powershell [2024/12/23 20:11] – created kenson | compile_powershell [2025/10/25 23:11] (current) – kenson | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Run powershell as administrator, | Run powershell as administrator, | ||
| + | < | ||
| Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass | Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass | ||
| Import-Module PS2EXE | Import-Module PS2EXE | ||
| ps2exe -inputfile ' | ps2exe -inputfile ' | ||
| + | </ | ||
| To add an icon | To add an icon | ||
| + | < | ||
| ps2exe -inputfile ' | ps2exe -inputfile ' | ||
| + | </ | ||
| To run as an GUI (no console) | To run as an GUI (no console) | ||
| + | < | ||
| ps2exe -inputfile ' | ps2exe -inputfile ' | ||
| + | </ | ||
| - | To sign the exe | + | To sign the binary, I followed the steps in the following docs: |
| - | https:// | + | * [[https:// |
| + | * [[https:// | ||
| + | Signing Command once everything is set up: | ||
| + | < | ||
| & " | & " | ||
| + | </ | ||
| + | |||
| + | The key is to get the following metadata correct and log into azure with the correct credentials | ||
| + | |||
| + | metadata.json | ||
| + | < | ||
| + | { | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | The CodeSigningAccountName is the TrustedSigningAccount in the Azure Dashboard | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The CertificateProfileName is the relevant entry in your CertificateProfile | ||
| + | |||
| + | {{: | ||
| + | |||
| + | To set up azure CLI environment for signing, from powershell run: | ||
| + | < | ||
| + | az login | ||
| + | </ | ||
| + | |||
| + | e.g. | ||
| + | |||
| + | < | ||
| + | PS C: | ||
| + | Select the account you want to log in with. For more information on login with Azure CLI, see https:// | ||
| + | |||
| + | Retrieving tenants and subscriptions for the selection... | ||
| + | |||
| + | [Tenant and subscription selection] | ||
| + | |||
| + | No | ||
| + | ----- --------------------- | ||
| + | [1] * Azure subscription 1 | ||
| + | [2] Code Signing Embrient | ||
| + | |||
| + | The default is marked with an *; the default tenant is ' | ||
| + | |||
| + | Select a subscription and tenant (Type a number or Enter for no changes):</ | ||
| + | |||
| + | |||
| + | Next set up for code signing via the command | ||
| + | |||
| + | < | ||
| + | az ad sp create --id cf2ab426-f71a-4b61-bb8a-9e505b85bc2e | ||
| + | </ | ||
| + | < | ||
| + | az ad app permission grant --id cf2ab426-f71a-4b61-bb8a-9e505b85bc2e --api 00000003-0000-0000-c000-000000000000 --scope User.Read | ||
| + | </ | ||
| + | |||
| + | < | ||
compile_powershell.1734984717.txt.gz · Last modified: 2024/12/23 20:11 by kenson
