Winforms .exe in MSIX Package Does Not Startup After Auto Update

Brass Contributor

We are deploying a classic Winforms .exe via MISX. Approximately 20% of the time, the application does not start automatically after an auto update completes. After an update and failed start, we can trigger the application to startup by just typing random text into the Windows search bar. Another way we can trigger it to start is to re-launch the application via the start menu item, but of course two instances will then be running. 

 

 

 

We are testing with 5 separate workstations that have Windows 10 1903. I have logging in the Main method of the application in program.cs, so I can see that nothing attempts to execute after the auto update until the user intervenes. This has lead me to believe that there is nothing in the application itself causing the issue, but rather the MSIX framework or a configuration option. 

 

The appinstaller file -

 

 

<?xml version="1.0" encoding="utf-8"?>
<AppInstaller Uri="{AppInstallerUri}"
              Version="{Version}"
              xmlns="<a href="<a href="<a href="http://schemas.microsoft.com/appx/appinstaller/2018" target="_blank">http://schemas.microsoft.com/appx/appinstaller/2018</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/appinstaller/2018</a" target="_blank">http://schemas.microsoft.com/appx/appinstaller/2018</a</a>>" target="_blank"><a href="<a href="http://schemas.microsoft.com/appx/appinstaller/2018</a" target="_blank">http://schemas.microsoft.com/appx/appinstaller/2018</a</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/appinstaller/2018</a</a" target="_blank">http://schemas.microsoft.com/appx/appinstaller/2018</a</a</a>>>">
  <MainBundle Name="{Name}"
              Version="{Version}"
              Publisher="{Publisher}"
              Uri="{MainPackageUri}"/>
  <UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
    <AutomaticBackgroundTask/>
    <ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
  </UpdateSettings>
</AppInstaller>

 

 

 
The appxmanifest -

 

 

 
<?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="<a href="<a href="<a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10</a</a>>" target="_blank"><a href="<a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10</a</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10</a</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10</a</a</a>>>"
  xmlns:uap="<a href="<a href="<a href="http://schemas.microsoft.com/appx/manifest/uap/windows10" target="_blank">http://schemas.microsoft.com/appx/manifest/uap/windows10</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/uap/windows10</a" target="_blank">http://schemas.microsoft.com/appx/manifest/uap/windows10</a</a>>" target="_blank"><a href="<a href="http://schemas.microsoft.com/appx/manifest/uap/windows10</a" target="_blank">http://schemas.microsoft.com/appx/manifest/uap/windows10</a</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/uap/windows10</a</a" target="_blank">http://schemas.microsoft.com/appx/manifest/uap/windows10</a</a</a>>>"
  xmlns:rescap="<a href="<a href="<a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a</a>>" target="_blank"><a href="<a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a</a>" target="_blank"><a href="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a</a" target="_blank">http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities</a</a</a>>>"
  IgnorableNamespaces="uap rescap">
  <Identity
    Name="IMSPolicy.local"
    Publisher="CN=Foo, O=Foo, L=MyTown, S=MyState, C=US"
    Version="1.0.14.0" />
  <Properties>
    <DisplayName>MyApp</DisplayName>
    <PublisherDisplayName>FooPublisher</PublisherDisplayName>
    <Logo>Images\StoreLogo.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
  </Dependencies>
  <Resources>
    <Resource Language="x-generate"/>
  </Resources>
  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="$targetentrypoint$">
      <uap:VisualElements
        DisplayName="MyApp Dev"
        Description="MyApp application package"
        BackgroundColor="transparent"
        Square150x150Logo="Images\Square150x150Logo.png"
        Square44x44Logo="Images\Square44x44Logo.png">
        <uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png"  Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
        <uap:SplashScreen Image="Images\SplashScreen.png"  BackgroundColor="white"/>
      </uap:VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="internetClient" />
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>
</Package>

 

 

46 Replies
Great investigation. Someone should start a support case with Microsoft so the bug will find its way into their systems and get more attention.

My workaround would probably be to restart the app after detecting a pending update.

@Lars_Pedersen I'm afraid I don't know how to open a formal support case. Does anyone have any experience with that? 

@MikeH try to fill the issue via FeedbackHub in Windows and post the link here, we'll upvote it. I already filed an issue on another problem with MSIX https://aka.ms/AAetpms
This issue (24406154) has been re-opened, and our development team will be investigating. I will track this issue, and provide updates as they become available.

Thank you,
Roy MacLachlan
@Roy was there any progress on this?
It's a shame. I went through all the trouble of setting up build pipelines for MSIX and documenting it. Now my team will probably continue using ClickOnce because of this bug...
Hi,
The development team is still working on this issue.

Thank you,
Roy

@Roy_MacLachlan Any update?  Our customers have been experiencing this same issue ever since we added the MSIX install.  

Hi,
The development team has been unable to re-produce the experience you are describing in this thread, providing the following comment:

 

Tested app upgrade with appinstaller files. Unable to reproduce described experience.

  • Tested with Virtual Machine running Windows 10 1903.
  • Upgrade settings configured in the appinstaller file.
  • App installed using the appinstaller files.
    • Blank winforms application
  • Used the Desktop Bridge to make the appinstaller files and packages.

Steps taken to re-produce experience:

  1. Modify both URI fields in both appinstaller files to work on your machine. (URIs must be absolute paths).
  2. Double-click on PackAppThatHasABug1010.appinstaller.
    1. Check "Launch when ready".
    2. Click "Install"
  3. While the app is open, double-click on PackAppThatHasABug2020.appinstaller.
    1. Check "Launch when ready".
    2. Click "Upgrade".
      ** The progress bar might stay at 55% for a moment or two.
  4. The app closes and reopens with no user intervention.

If the problem is still happening please re-open the ticket with both appinstallers and the packages so I can test locally.

 

 

Please let me know if the above is helpful, and if possible please share the appinstaller file and MSIX packaged app that is resulting in this negative experience.

 

Thank you,

Roy MacLachlan

Hmm, that's not how I repro the error.

I only have one .appinstaller file.
I Install the app, then close it.
Then I modify the .appinstaller file to point to a different version in order to simulate an upgrade.
Then I click the .appinstaller file. The app asks to upgrade and the upgrade dialog finishes and closes.
Then nothing happens until I click the Windows button, or inside the search field in the taskbar, then suddenly the upgraded app starts up.
That's a bug that's been around for a long time, I think it's in the task bar. People have been reporting it for years but Microsoft don't seem able to repro/fix it.
Oh, sorry, I just realized that this is the thread where we're reporting it.

@Roy - that isn't the right set of reproduction steps indeed. Can you please try again?

1. Try the instructions provided by Lars. App not running at the time.

2. Try the instructions provided by me. Specifically, what I reported was that this happens when the appinstaller is configured to check for an update on every single launch, and then you start the app from the start bar with a pending update. You may also need to fiddle around with this quite a bit because it seems like you have to do something specific to get Windows into such a state.

It might also be worth just asking the developers to read the code carefully and see if they can spot any way in which this can happen.

Hi @MikeH,

 

I've re-opened the Bug and have included additional information shared by yourself and @Lars_Pedersen regarding this negative experience.

 

Hopefully they will be able to re-produce and identify the problem.

 

I appreciate the time taken to provide the descriptive information that has been shared in this post, as it'll help us to find and resolve what is happening. Thank you everyone!

 

Thanks,

Roy

Hi @MikeH,

 

The developer that is working on this is unable to re-create the experience and is asking for a further, more explicit breakdown of steps that re-trigger this experience. Looking at previous comments I do not see an exact list of steps.

 

Can you or someone following this discussion please provide this?

 

Thank you,

Roy

 

 

@Roy_MacLachlan 

 

I deploy an MSIX app to a shared folder from where my users will install from.


I have 2 versions, the old .3501 and the new, 3504.

MasterData.appinstaller points to the new version.

 

I make 2 copies of the .appinstaller file, one called New and the other called Old.

 

Lars_Pedersen_0-1660295464223.png

 

Then I modify the MasterData - Old.appinstaller file to point at an old version (.3501).

It should look like this:

<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="file://XXX/MasterData/Test/MasterData.appinstaller"
Version="2022.329.1519.3501" xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
<MainBundle
Name="067d1aa7-6a9d-4195-b04c-4dc1f12837c1-test"
Version="2022.329.1519.3501"
Publisher="CN=XXX"
Uri="file://XXX/MasterData/Test/MasterData_2022.329.1519.3501/MasterData_2022.329.1519.3501_x64.msixbundle" />
<UpdateSettings>
<OnLaunch ShowPrompt="true" UpdateBlocksActivation="true"
HoursBetweenUpdateChecks="0" />
<AutomaticBackgroundTask />
<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
</UpdateSettings>
</AppInstaller>

 

Then I delete MasterData.appinstaller and copy MasterData - Old.appinstaller, and rename it to MasterData.appinstaller.

Then I install the app by clicking MasterData.appinstaller.

Then I close the app.


Now I want to simulate an upgrade of the app.

First I delete MasterData.appinstaller. Then I copy MasterData - New.appinstaller and rename it to MasterData.appinstaller.

Then I go to Windows->Start and run MasterData. The upgrade dialog appears:

Lars_Pedersen_1-1660296621912.png

I click on Update and the update finishes. The dialog closes, but nothing happens. <- This is the bug.

Then I click on the Windows button, and the upgraded app opens.

 




 

 

 

 

 

 

 

Thanks to Lars for repro steps. @Roy_MacLachlan - to get everyone on the same page, can you find out what exact version of Windows and AppInstaller your developer is using? Let's rule out the possibility that you've already got it fixed in a build we're not using. Or better, ask your dev to come here directly so we can iterate faster?

 

I haven't tried to repro it lately, but I'll try to get an independent set of repro steps next week.

We are having a similar issue as well. We distribute the app via our website having users download and open the appinstaller file. The app installs & launches fine. After that even just trying to launch from the Start menu icon which is created doesn't launch the app until you click the Search icon in the taskbar. This has been happening ever since we moved to MSIX, on Windows 10, continued after updating to Win11, and still continues after I reformatted and reinstalled Win11 fresh.

@Roy_MacLachlan any news on this?

Has someone been able to work around this problem? (for example with a custom update process like alluded to here):

https://github.com/MicrosoftDocs/msix-docs/issues/59

??

In case that helps: we have the exact same problem but only on some computers: for some the problem always reproduces, for other it never happens.

That's on the exact same application, so the problem seems to be either on the computer itself or some interaction between the computer and the application.

 

We have not seen any obvious difference between the computers but we're not sure what to look for.