diff --git a/.github/workflows/delete_store_submission.yml b/.github/workflows/delete_store_submission.yml deleted file mode 100644 index fa525bd88..000000000 --- a/.github/workflows/delete_store_submission.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Delete Store Submission - -on: - workflow_dispatch: - -jobs: - delete_submission: - name: Delete Store Submission - runs-on: ubuntu-latest - steps: - - name: Configure Store Credentials 🔑 - uses: jandedobbeleer/store-submission@submission-status - with: - command: configure - type: win32 - seller-id: ${{ secrets.SELLER_ID }} - product-id: ${{ secrets.PRODUCT_ID }} - tenant-id: ${{ secrets.TENANT_ID }} - client-id: ${{ secrets.CLIENT_ID }} - client-secret: ${{ secrets.CLIENT_SECRET }} - - - name: Delete Submission 🗑️ - uses: jandedobbeleer/store-submission@submission-status - with: - command: delete diff --git a/.github/workflows/microsoft_store.yml b/.github/workflows/microsoft_store.yml deleted file mode 100644 index f9469b76a..000000000 --- a/.github/workflows/microsoft_store.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Windows Store -on: - release: - types: [published] - -jobs: - microsoft_store: - name: Publish To Windows Store - runs-on: ubuntu-latest - steps: - - name: Configure Store Credentials 🔑 - uses: jandedobbeleer/store-submission@submission-status - with: - command: configure - type: win32 - seller-id: ${{ secrets.SELLER_ID }} - product-id: ${{ secrets.PRODUCT_ID }} - tenant-id: ${{ secrets.TENANT_ID }} - client-id: ${{ secrets.CLIENT_ID }} - client-secret: ${{ secrets.CLIENT_SECRET }} - only-on-ready: true - - name: Update draft submission - uses: jandedobbeleer/store-submission@submission-status - with: - command: update - product-update: '{ - "packages":[ - { - "packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/${{ github.event.release.tag_name }}/install-x64.msi", - "languages":["en"], - "architectures":["X64"], - "installerParameters":"/quiet INSTALLER=ws", - "isSilentInstall":false - }, - { - "packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/${{ github.event.release.tag_name }}/install-arm64.msi", - "languages":["en"], - "architectures":["Arm64"], - "installerParameters":"/quiet INSTALLER=ws", - "isSilentInstall":false - } - ] - }' - - name: Publish Submission - uses: jandedobbeleer/store-submission@submission-status - with: - command: publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e011caa59..d6a7d0d67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,7 +91,7 @@ jobs: src/dist/posh-* src/dist/themes.* src/dist/checksums.* - msi: + msix: needs: - changelog - artifacts @@ -102,7 +102,7 @@ jobs: defaults: run: shell: pwsh - working-directory: ${{ github.workspace }}/packages/msi + working-directory: ${{ github.workspace }}/packages/msix steps: - name: Checkout code 👋 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 @@ -110,8 +110,6 @@ jobs: with: name: build-artifacts path: dist - - name: Install Wix Toolset 🛠 - run: dotnet tool install --global wix - name: Build installer 📦 id: build env: @@ -123,16 +121,15 @@ jobs: ./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Copy -Sign -SDKVersion "10.0.26100.0" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: - name: msi-artifact-${{ matrix.arch }} + name: msix-artifact-${{ matrix.arch }} path: | - packages/msi/out/install-${{ matrix.arch }}.msi - packages/msi/out/install-${{ matrix.arch }}.msix + packages/msix/out/install-${{ matrix.arch }}.msix release: runs-on: ubuntu-latest needs: - changelog - artifacts - - msi + - msix - android steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c @@ -193,9 +190,7 @@ jobs: $version = $version.TrimStart('v') $urls = @( - "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msi|x64", "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msix|x64", - "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msi|arm64", "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msix|arm64" ) diff --git a/.gitignore b/.gitignore index 3f821b48e..c3978786f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,7 @@ apm_modules/ src/test/umbraco/obj/ src/keys *.prof -*.wixpdb -packages/msi/Microsoft.Trusted.Signing.Client +packages/msix/Microsoft.Trusted.Signing.Client .claude .styles diff --git a/packages/msi/README.md b/packages/msi/README.md deleted file mode 100644 index 4c4459156..000000000 --- a/packages/msi/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# MSI Package - -## Prerequisites - -- [dotnet] -- [wix]: `dotnet tool install --global wix` - -## Build the package - -This guide assumes and advices the use of PowerShell as your shell environment for this purpose. - -### Set the environment variables - -```powershell -$env:VERSION = "1.3.37" -``` - -### Build the installer - -```powershell -wix build -arch arm64 -out install-arm64.msi -``` - -## Install the package - -### For the current user - -```powershell -install-arm64.msi -``` - -### For all users - -```powershell -install-arm64.msi ALLUSERS=1 -``` - -[dotnet]: https://dotnet.microsoft.com/en-us/download/dotnet?cid=getdotnetcorecli -[wix]: https://wixtoolset.org/docs/intro/ diff --git a/packages/msi/icon.ico b/packages/msi/icon.ico deleted file mode 100644 index 9bbf13c61..000000000 Binary files a/packages/msi/icon.ico and /dev/null differ diff --git a/packages/msi/oh-my-posh.wxs b/packages/msi/oh-my-posh.wxs deleted file mode 100644 index e96840539..000000000 --- a/packages/msi/oh-my-posh.wxs +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/msix/README.md b/packages/msix/README.md new file mode 100644 index 000000000..24f695613 --- /dev/null +++ b/packages/msix/README.md @@ -0,0 +1,26 @@ +# MSIX Package + +## Prerequisites + +- [Windows SDK] (provides `makeappx.exe` and `signtool.exe`) + +## Build the package + +This guide assumes and advises the use of PowerShell as your shell environment for this purpose. + +Place the executable to package at `./dist/oh-my-posh.exe`, or use `-Copy` to take it from +the repository's `dist` folder. + +```powershell +./build.ps1 -Architecture x64 -Version "1.3.37" +``` + +The package is created at `out/install-x64.msix`. + +## Install the package + +```powershell +Add-AppxPackage -Path ./out/install-x64.msix +``` + +[Windows SDK]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ diff --git a/packages/msi/appxmanifest.xml b/packages/msix/appxmanifest.xml similarity index 100% rename from packages/msi/appxmanifest.xml rename to packages/msix/appxmanifest.xml diff --git a/packages/msi/build.ps1 b/packages/msix/build.ps1 similarity index 76% rename from packages/msi/build.ps1 rename to packages/msix/build.ps1 index 5f522af8c..942d08fce 100644 --- a/packages/msi/build.ps1 +++ b/packages/msix/build.ps1 @@ -1,10 +1,10 @@ <# .SYNOPSIS - Builds MSI and MSIX packages for Oh My Posh. + Builds the MSIX package for Oh My Posh. .DESCRIPTION - This script creates MSI and MSIX installer packages for Oh My Posh with the specified architecture and version. - It can optionally copy the executable, sign the packages, and generate hash files for verification. + This script creates the MSIX installer package for Oh My Posh with the specified architecture and version. + It can optionally copy the executable and sign the package. .PARAMETER Architecture The target architecture for the package. Must be either 'x64' or 'arm64'. @@ -16,7 +16,7 @@ The Windows SDK version to use for signing and packaging tools. Defaults to "10.0.26100.0". .PARAMETER Sign - When specified, signs the MSI and MSIX packages using Azure Code Signing. + When specified, signs the MSIX package using Azure Code Signing. .PARAMETER Copy When specified, copies the appropriate executable from the dist folder before packaging. @@ -24,21 +24,18 @@ .EXAMPLE .\build.ps1 -Architecture x64 -Version "1.2.3" -Copy - Creates MSI and MSIX packages for x64 architecture with version 1.2.3, copying the executable first. + Creates the MSIX package for x64 architecture with version 1.2.3, copying the executable first. .EXAMPLE .\build.ps1 -Architecture arm64 -Version "1.2.3" -Sign -Copy - Creates and signs MSI and MSIX packages for arm64 architecture with version 1.2.3. + Creates and signs the MSIX package for arm64 architecture with version 1.2.3. .OUTPUTS - Creates the following files in the 'out' directory: - - install-{Architecture}.msi - - install-{Architecture}.msix - - Hash files (.sha256) for verification + Creates install-{Architecture}.msix in the 'out' directory. .NOTES - Requires WiX toolset for MSI creation and Windows SDK for MSIX packaging and signing. + Requires the Windows SDK for MSIX packaging and signing. #> [CmdletBinding()] @@ -156,7 +153,7 @@ function Invoke-PackageSigning { #region Main Script -Write-Verbose "Building MSI for $Architecture with version $Version" -Verbose +Write-Verbose "Building MSIX for $Architecture with version $Version" -Verbose Write-Verbose "Setting up output directories" -Verbose try { @@ -189,33 +186,6 @@ if ($Copy) { } } -# Set version environment variable for WiX -$env:VERSION = $Version - -Write-Verbose "Creating MSI package" -Verbose - -try { - # Define MSI package paths - $msiFileName = "install-$Architecture.msi" - $msiPackagePath = "$PWD/out/$msiFileName" -replace '\\', '/' - - Write-Verbose "Building MSI: $msiPackagePath" -Verbose - wix build -acceptEula wix7 -arch $Architecture -out $msiPackagePath .\oh-my-posh.wxs - - if (-not (Test-Path $msiPackagePath)) { - throw "MSI package was not created successfully" - } -} -catch { - Write-Error "Failed to create MSI package: ${_}" - throw -} - -if ($Sign) { - $signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion - Invoke-PackageSigning -PackagePath $msiPackagePath -SigningTools $signingTools -} - Write-Verbose "Creating MSIX package" -Verbose try { @@ -223,7 +193,7 @@ try { $currentPath = $PWD -replace '\\', '/' $manifestPath = "$currentPath/appxmanifest.xml" $mappingFilePath = "$currentPath/mapping.txt" - $msixPackagePath = "$currentPath/out/$($msiFileName)x" + $msixPackagePath = "$currentPath/out/install-$Architecture.msix" $makeappxPath = "C:/Program Files (x86)/Windows Kits/10/bin/$SDKVersion/x64/makeappx.exe" # Validate required files exist @@ -257,12 +227,10 @@ catch { } if ($Sign) { - if ($null -eq $signingTools) { - $signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion - } + $signingTools = Initialize-SigningEnvironment -SDKVersion $SDKVersion Invoke-PackageSigning -PackagePath $msixPackagePath -SigningTools $signingTools } -Write-Verbose "Successfully completed building MSI and MSIX packages" -Verbose +Write-Verbose "Successfully completed building the MSIX package" -Verbose #endregion diff --git a/packages/msi/dsc/oh-my-posh.config.dsc.resource.json b/packages/msix/dsc/oh-my-posh.config.dsc.resource.json similarity index 100% rename from packages/msi/dsc/oh-my-posh.config.dsc.resource.json rename to packages/msix/dsc/oh-my-posh.config.dsc.resource.json diff --git a/packages/msi/dsc/oh-my-posh.font.dsc.resource.json b/packages/msix/dsc/oh-my-posh.font.dsc.resource.json similarity index 100% rename from packages/msi/dsc/oh-my-posh.font.dsc.resource.json rename to packages/msix/dsc/oh-my-posh.font.dsc.resource.json diff --git a/packages/msi/dsc/oh-my-posh.shell.dsc.resource.json b/packages/msix/dsc/oh-my-posh.shell.dsc.resource.json similarity index 100% rename from packages/msi/dsc/oh-my-posh.shell.dsc.resource.json rename to packages/msix/dsc/oh-my-posh.shell.dsc.resource.json diff --git a/packages/msi/icons/44.png b/packages/msix/icons/44.png similarity index 100% rename from packages/msi/icons/44.png rename to packages/msix/icons/44.png diff --git a/packages/msi/icons/icon.png b/packages/msix/icons/icon.png similarity index 100% rename from packages/msi/icons/icon.png rename to packages/msix/icons/icon.png diff --git a/packages/msi/mapping.txt b/packages/msix/mapping.txt similarity index 100% rename from packages/msi/mapping.txt rename to packages/msix/mapping.txt diff --git a/src/cli/upgrade/notice.go b/src/cli/upgrade/notice.go index 25aedba69..816e180b6 100644 --- a/src/cli/upgrade/notice.go +++ b/src/cli/upgrade/notice.go @@ -2,10 +2,8 @@ package upgrade import ( "fmt" - "os" "github.com/jandedobbeleer/oh-my-posh/src/build" - "github.com/jandedobbeleer/oh-my-posh/src/log" "github.com/jandedobbeleer/oh-my-posh/src/runtime/http" ) @@ -25,12 +23,6 @@ To enable automated upgrades, run: 'oh-my-posh enable upgrade'. // // The upgrade check is only performed every other week. func (cfg *Config) Notice() (string, bool) { - // never validate when we install using the Windows Store - if os.Getenv("POSH_INSTALLER") == "ws" { - log.Debug("skipping upgrade check because we are using the Windows Store") - return "", false - } - if !http.IsConnected() { return "", false } diff --git a/src/cli/upgrade/notice_test.go b/src/cli/upgrade/notice_test.go index 33370f4e8..1ec10e268 100644 --- a/src/cli/upgrade/notice_test.go +++ b/src/cli/upgrade/notice_test.go @@ -5,7 +5,6 @@ import ( "net/http" "net/http/httptest" "net/url" - "os" "testing" "github.com/jandedobbeleer/oh-my-posh/src/build" @@ -56,25 +55,17 @@ func TestCanUpgrade(t *testing.T) { cases := []struct { Case string CurrentVersion string - Installer string Expected bool }{ {Case: "Up to date", CurrentVersion: latest}, {Case: "Outdated Linux", Expected: true, CurrentVersion: "3.0.0"}, {Case: "Outdated Darwin", Expected: true, CurrentVersion: "3.0.0"}, - {Case: "Windows Store", Installer: "ws"}, } for _, tc := range cases { build.Version = tc.CurrentVersion - if len(tc.Installer) > 0 { - os.Setenv("POSH_INSTALLER", tc.Installer) - } - _, canUpgrade := ugc.Notice() assert.Equal(t, tc.Expected, canUpgrade, tc.Case) - - os.Setenv("POSH_INSTALLER", "") } }