[SOLVED] Problem with install_msi_if_needed and msix file

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 9, 2023 - 3:24 PM

Good morning
I want to develop a package for the new MS-TEAMS which is provided as msix.

But when I try a simple install_msi_if_needed('MSTeams-x86.msix') in pyscripter, I get this output:

Code: Select all

2023-11-09 15:13:13,714 CRITICAL Fatal error in install script: MSIError: open failed:
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4083, in install_wapt
    exitstatus = setup.install()
  File "c:\waptdev\ln-msteams-x86_0.0.0_Windows_PROD\setup.py", line 16, in install
    install_msi_if_needed('MSTeams-x86.msix')
  File "C:\Program Files (x86)\wapt\common.py", line 4033, in new_func
    return func(*args, **kwargs)
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 1379, in install_msi_if_needed
    key = get_msi_properties(msi)['ProductCode']
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 2825, in get_msi_properties
    db = msilib.OpenDatabase(msi_filename, msilib.MSIDBOPEN_READONLY)
_msi.MSIError: open failed

FATAL ERROR : MSIError: open failed
Exit code:  3
Any idea what's going on?
Last edited by t.heroult on Nov 10, 2023 - 4:31 PM, edited 1 time.
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

November 9, 2023 - 5:50 PM

Hi Thomas,

it seems to me that the msix format has very little to do with the msi format. The msilib library, which is used underlying the install_msi_if_needed function, doesn't apparently handle it.

For now, we'll have to run it with something like run(), I believe...

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 10, 2023 - 09:08

I understand, but what's inconsistent is that from the console, I launched the new package wizard, the first option offering msi, msix, and exe, and after selecting msix, PyScripter opens with the `install_msi_if_needed` line already created.
This needs to be reviewed if the function can't handle msix files.
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 10, 2023 - 10:54

So, I don't see how to install MSIX with WAPT.
The simplest way would normally be to use PowerShell with Add-AppxPackage, except that this operation isn't possible with the LOCAL SYSTEM account used by WAPT...
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

November 10, 2023 - 11:01

Indeed, I just saw that msix is ​​hardcoded in waptconsole

We're going to remove the reference; it's a historical error

In the meantime, you can try something like this:

Code: Select all


def install():
    filecopyto('MyApp.msix','c:\MyApp.msix')

def session_setup():
    run(r'powershell Add-AppPackage -path "c:\MyApp.msix"')
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 10, 2023 - 11:42

Hi Simon
, as I mentioned in my previous comment, it's not working.
At least, it works in PyScripter since it's launched with my account, but the WAPT agent runs with the SYSTEM LOCAL account, which doesn't have permission to run "PowerShell Add-AppxPackage". This is forbidden by Windows, and the same applies to Add-AppPackage itself.
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

November 10, 2023 - 12:35

But in my example it's a session_setup, so not a system, so it doesn't work either?
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 10, 2023 - 12:41

I don't know what the result would be in session_setup...
I'll test it and see.

More later!
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
t.heroult
Messages: 307
Registration: December 8, 2020 - 10:13 AM

November 10, 2023 - 3:04 PM

Negative feedback, nothing happens.
The command used is: powershell Add-AppPackage -Path "C:\Software\bin\MSTeams-x64.msix"
Launched by session_setup: nothing happens
Launched from a PowerShell window (standard user): it works...

Code: Select all


def session_setup():
    cmd = 'powershell Add-AppPackage -Path "C:\Logiciels\bin\MSTeams-x64.msix"'
    run(cmd)
Server: WAPT Enterprise 2.6.1.17786 on Debian
Consoles: Windows 10 & 11
Infrastructure: Windows

Did you know? When parrotfish undergo smoltification, their osmoregulation mechanism is reversed!
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

November 10, 2023 - 3:42 PM

Hmm, the 'r' before the string?

Or should I just use the full path:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Locked