App-V to MSIX Conversion: WorkingDirectory skipped during conversion

Written by Horatiu Vladasel · October 5th, 2023

In our latest article, we discussed App-V to MSIX conversion: Shortcut argument skipped during conversion. But that’s just the tip of the iceberg. The same goes for WorkingDirectory.

In today’s article, we're diving deep into this issue, using the popular VLC Media Player as an illustration.

WorkingDirectory Challenges

When converting from App-V 5 to MSIX, any WorkingDirectory set within the App-V 5 package gets overlooked. For most applications, post-conversion, everything runs smoothly. But, for some of them, it doesn’t.

How? Because when packaged as MSIX, the application's default working directory becomes the System32 folder.

Let’s take an example!

A quick inspection of VLC Media Player’s “Start in” field reveals it to be "C:\Program Files (x86)\VideoLAN\VLC" - the WorkingDirectory of that shortcut.

VLC Media Player shortcut WorkingDirectory

Understanding Shortcut Arguments in App-V 5

Those of you familiar with AppV-5 might already know the shortcut arguments can be specified within the App-V 5 AppXManifest.xml.

Here is how it appears for the VLC Media Playershortcut:

<appv:Extension Category="AppV.Shortcut">
            	<appv:Shortcut>
                 	<appv:File>[{Common Desktop}]\VLC media player.lnk</appv:File>
            	 	<appv:Target>[{ProgramFilesX86}]\VideoLAN\VLC\vlc.exe</appv:Target>
            	 	<appv:Icon>[{ProgramFilesX86}]\VideoLAN\VLC\vlc.exe.0.ico</appv:Icon>
                 	<appv:Arguments />
            	 	<appv:WorkingDirectory>[{ProgramFilesX86}]\VideoLAN\VLC</appv:WorkingDirectory>
                 	<appv:ShowCommand>1</appv:ShowCommand>
            	 	<appv:ApplicationId>[{ProgramFilesX86}]\VideoLAN\VLC\vlc.exe</appv:ApplicationId>
            	</appv:Shortcut>
       	</appv:Extension>

Investigating the Converted MSIX Package

Post-conversion to MSIX, a look into AppXManifest.xml and we see the WorkingDirectory is skipped during conversion.

<Application Id="VLC" Executable="VFS\ProgramFilesX86\VideoLAN\VLC\vlc.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements BackgroundColor="transparent" DisplayName="VLC media player" Square150x150Logo="Assets\VLC-Square150x150Logo.png" Square44x44Logo="Assets\VLC-Square44x44Logo.png" Description="VLC media player">
        <uap:DefaultTile Wide310x150Logo="Assets\VLC-Wide310x150Logo.png" Square310x310Logo="Assets\VLC-Square310x310Logo.png" Square71x71Logo="Assets\VLC-Square71x71Logo.png" />
      </uap:VisualElements>
      <Extensions>
        <desktop7:Extension Category="windows.shortcut">
          <desktop7:Shortcut File="[{Common Programs}]\VideoLAN\VLC media player - reset preferences and cache files.lnk" Icon="[{Package}]\VFS\ProgramFilesX86\VideoLAN\VLC\vlc.exe" Arguments="--reset-config --reset-plugins-cache vlc://quit" />
 	</desktop7:Extension>
        <desktop7:Extension Category="windows.shortcut">
          <desktop7:Shortcut File="[{Common Programs}]\VideoLAN\VLC media player skinned.lnk" Icon="[{Package}]\VFS\ProgramFilesX86\VideoLAN\VLC\vlc.exe" Arguments="-Iskins" />
        </desktop7:Extension>
        <desktop7:Extension Category="windows.shortcut">
          <desktop7:Shortcut File="[{Common Programs}]\VideoLAN\VLC media player.lnk" Icon="[{Package}]\VFS\ProgramFilesX86\VideoLAN\VLC\vlc.exe" />
        </desktop7:Extension>

So, how do we fix this?

You need to inject Package Support Framework into the converted MSIX Package and define the WorkingDir via the config.json file.

Using the MSIX Packaging Tool? This step's on you.

NoteLooking for details on setting shortcut WorkingDirectory using Package Support Framework?
We've got you covered in our article about overcoming MSIX limitations with the PSF.

Advanced Installer

Now, for those using Advanced Installer, there’s good news. All this gets handled automatically during the App-V 5 to MSIX conversion. No extra work required.

  1. Browse to the “Application Details” page;
  2. Select VLC Media Player entry;
  3. That’s it. The “Working Directory” info is auto-filled using data from the App-V 5 package.

NoteHere’s a detailed guide on How to convert an App-V 5 file to MSIX.

VLC App Shortcut WorkingDirectory in Advanced Installer

Unleash the power of hassle-free conversions with Advanced Installer's 30-day free trial!

Wrapping Up

Converting from App-V 5 to MSIX is a great way to migrate your App-V packages without repackaging.

However, some bumps on the road, like the WorkingDirectory issue, can crop up. Advanced Installer makes this journey smoother.

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: