Execute MSI files from a different location

Hello,

I have an app that I am trying to package, but it has multiple MSI files and has multiple files. I want to package it up into a .wim and then expand the .wim file in a different directory than where the PSADT is. Packaging the .wim and extracting it to a different location is easy to do and not the issue.

The issue comes when in the PSADT code, when running the Execute-MSI function, it always looks in the $dirFiles (“Files” sub directory of the App Deploy Toolkit) and not in the new location, even when I specify the location with the -WorkingDirectory.

We want to keep it in a .wim so that it keeps a layer of security as well as improves efficiency (I/O open and closures for each file) and thus, we need to be able to tell the Execute-MSI function to look in a different directory all together for the MSI files, in our case: C:\Users\Public\mount_appname

Any help would greatly appreciated and thank you for your time.

Execute-MSI has a -Path parameter.

So give it the full path to the extracted MSI:
-Path "C:\Users\Public\mount_appname\NameOfFirst.MSI"

No full path? Just a filename? PSADT assumes it’s in $DirFiles

Wow, that is so simple. I was way over thinking it and thought I needed to use the -WorkingDirectory along with the -Path parameter. Thank you for pointing me in the right direction as it totally works. Just super curious as how one would use the -WorkingDirectory parameter and why?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.