#Trying to have 2 different versions of the same app deployed at the same time and using the updater

33 messages · Page 1 of 1 (latest)

teal pond
#

Hello, a few months ago I started developing a desktop application for a company and decided to use Tauri, so far the experience has been very good, we are already carrying out the first pilot tests of the application and the client is very happy but yesterday I encountered a small problem that I had not taken into account. Before the deployment of each new version, this company will carry out a version certification process, so it is necessary to have both versions deployed. I was investigating if there was any official documentation about the possibility of doing this but I couldn't find anything so I decided to use the same github action that is responsible for doing the build and deployment to production in my dev branch with the difference that it publishes the versions as prerelease and using different versioning (vX.X.X-canary.X). Then I made some changes to my server so that the updater kept running and it worked perfectly fine on macOS, but on Windows the build failed because the version is not numeric only.

So, I have some questions:

  1. Do you consider this is the correct approach or do you think there is a better alternative?

  2. Is there any official solution to this problem?

  3. If I wanted to follow this path, how can I resolve the error in the Windows build?

Thank you very much in advance!!!

#

This is the github action im using

ember ermine
#

what’s the exact version you’re using? prerelease should work fine

#

CrabNebula is an official Tauri partner

teal pond
# teal pond This is the github action im using

# This will trigger the action on each push to the development branch.
on:
  push:
    branches:
      - development

jobs:
  publish-release:
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        include:
          - platform: 'macos-latest' # for Arm based macs (M1 and above).
            args: '--target aarch64-apple-darwin'
          # - platform: 'macos-latest' # for Intel based macs.
          #   args: '--target x86_64-apple-darwin'
          - platform: 'windows-latest'
            args: ''

    runs-on: ${{ matrix.platform }}
    steps:
      - name: checkout repository
        uses: actions/checkout@v4

      - name: setup node
        uses: actions/setup-node@v4
        with:
          node-version: lts/*

      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
        with:
          # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
          targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

      - name: Rust cache
        uses: swatinem/rust-cache@v2
        with:
          workspaces: './src-tauri -> target'

      - name: install frontend dependencies
        run: npm install # change this to npm or pnpm depending on which one you use

      - name: build the app
        uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
        with:
          tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
          releaseName: 'v__VERSION__'
          releaseBody: 'See the assets to download this version and install.'
          releaseDraft: false
          prerelease: true
          args: ${{ matrix.args }}
teal pond
dark marsh
#

the msi installer or at least the wix toolset does simply not support non-numeric pre release identifiers. The error is correct about that. Only something like v1.1.4-1234 is supported, and even that will be converted by us to 1.1.4.1234 so that wix/msi accept it...

#

So you either have to switch to numeric prerelease ids (on windows) or use the nsis (setup.exe) installer instead of .msi

#

okay just checked, it's not a .msi limitation but a wix limitation. wix 4 does support semver now but migrating to it is not a priority rn (especially since it's such a pain to use outside of c# projects now...)

#

(i'd still like to work on wix4 support for some 2.x release tbh)

teal pond
dark marsh
#

in your tauri.conf.json file there should be "targets": "all" or something like that. You can replace "all" with an array of bundles you want. In v1 that'd be ["app", "dmg", "appimage", "deb", "nsis", "updater"]

#

or you use the -b nsis,updater cli flag on the windows runner only

teal pond
#

Okay, I'll try it and see how it goes. Is there any significant difference between the .msi and the .exe?

junior parcel
dark marsh
#

right totally forgot about that

#

to my defense, that was like 3 weeks ago?

junior parcel
# dark marsh right totally forgot about that

Can you point me to what part of the codebase/repo I should take a closer look at to see if I can take a crack at it? We use msi for my app and for some strange reason that I can't quite put in words, I seem to prefer it over nsis 🙈

dark marsh
#

somewhere in tooling/bundler

#

there's wix.rs and templates/main.wxs i think

#

the big problem here is that the distribution method of wix changed to be nuget based

#

which imo was a totally braindead decision but let's not go there

teal pond
dark marsh
#

same

#

the problem is just that the .msi tooling is hot garbage

teal pond
#

@dark marsh I'd also like to ask you about something related to the macOS installer, since I updated the github action to specifically target Arm-based Macs, the app installs apparently correctly but when I try to open it I get this error message

#

Could you take a look at my code when you have some time? I don't understand what could be happening

dark marsh
#

macos is stricter about arm apps

#

if they aren't signed it will show that error

#

you can apparently sign it with an "empty" cert basically by setting signingIdentity in tauri.conf.json to "-" i think and that should also help

junior parcel
#

You can try to run the app using the following command on the destination machine as a workaround 😅

xattr -d com.apple.quarantine <PATH TO .app file>