Oct 30 2019 08:56 AM - edited Oct 31 2019 07:28 AM
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>
<?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>
Nov 01 2019 06:28 PM
A few questions:
C:\Users\<UserName>\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\AILog.txt from when this issue occurs.
And just to make sure, can you please check Task Manager to see if your app's process is present when the issue occurs.
Thanks
Tanaka
Nov 04 2019 10:17 AM
1. Yes, that is correct.
2. attached
3. The application's process does not appear in Task Manager during a hang.
Nov 11 2019 05:53 PM
Nov 25 2019 07:30 AM
@Tanaka_Jimha - Hi Tanaka,
Just checking in to see if there has been any movement on this item.
Regards
Nov 25 2019 02:26 PM
Hi @ChreesM,
I don't have an update from the dev team yet. I'll let you know once I do. Some folks are out for Thanksgiving this week.
Cheers,
Tanaka
Dec 05 2019 05:31 PM
Hi @ChreesM
Unfortunately our devs weren't able to reproduce the issue and the logs aren’t showing anything so we don't have anything to use for debugging right now.
Are you able to reproduce the issue on one of your machines currently? I understand it can be hard since you said it only happens 20% of the time. Our best bet to get to the bottom of it now is for you to file a Feedback Hub bug while the issue is occurring -, this will collect a lot more logs & traces and help us investigate. If you can reproduce the error, can please try capture it using Feedback Hub:
Launch Feedback Hub
Category -> Problem -> Install & Update -> App installation issues
Make new bug
Important functionality not working
Recreate My Problem -> Start Recording
Try reproduce the issue
Stop recording
Submit
Thanks!
Tanaka
Dec 11 2019 11:50 AM - edited Dec 11 2019 11:51 AM
@Tanaka_Jimha- We have been able to reproduce the error on multiple machines about every 5th update, as long as there is a legitimate code change versus just incrementing the version number. We were not successful reproducing the error when there is not a real code change involved.
We will attempt to capture with Feedback Hub. Do you want me to post the results to this thread?
Dec 11 2019 06:39 PM
Yes please update the thread when you've managed to capture via Feedback Hub.
Thanks,
Tanaka
Dec 16 2019 12:45 PM
@Tanaka_Jimha- We captured the issue today with Feedback Hub. Files attached as requested.
Dec 17 2019 11:28 AM
Jan 14 2020 08:12 AM
@Tanaka_Jimha- We have been doing some more internal testing/investigation of this issue. We setup a fresh VM with Windows 10 (build 1909), and made sure there isn't any antivirus software, group policy, etc. We are still experiencing the issue. We did note an error in the Appx log, although ultimately the deployment was successful, we just had to jumpstart the process.
Event Viewer – Administrative Events
Error 1/14/2020 6:27:00 AM AppModel-Runtime 69 None
Failed with 0x490 modifying AppModel Runtime status for package IMSPolicy.Test_3.0.20014.1_neutral__jth0c9f684k02 for user CARPENTERD-TEST\DeleteMe (current status = 0x0, desired status = 0x20).
Log Name: Microsoft-Windows-AppModel-Runtime/Admin
Source: Microsoft-Windows-AppModel-Runtime
Date: 1/14/2020 6:27:00 AM
Event ID: 69
Task Category: None
Level: Error
Keywords: Process
User: SYSTEM
Computer: carpenterd-test.svmic.com
Description:
Failed with 0x490 modifying AppModel Runtime status for package IMSPolicy.Test_3.0.20014.1_neutral__jth0c9f684k02 for user CARPENTERD-TEST\DeleteMe (current status = 0x0, desired status = 0x20).
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-AppModel-Runtime" Guid="{f1ef270a-0d32-4352-ba52-dbab41e1d859}" />
<EventID>69</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x2000000000000001</Keywords>
<TimeCreated SystemTime="2020-01-14T14:27:00.545054900Z" />
<EventRecordID>900</EventRecordID>
<Correlation ActivityID="{766f81f1-cae6-0000-3798-6f76e6cad501}" />
<Execution ProcessID="4416" ThreadID="4564" />
<Channel>Microsoft-Windows-AppModel-Runtime/Admin</Channel>
<Computer>carpenterd-test.svmic.com</Computer>
<Security UserID="S-1-5-18" />
</System>
<EventData>
<Data Name="ErrorCode">1168</Data>
<Data Name="PackageFullName">IMSPolicy.Test_3.0.20014.1_neutral__jth0c9f684k02</Data>
<Data Name="User">S-1-5-21-4057247019-2708646856-1072159069-1001</Data>
<Data Name="DesiredStatus">32</Data>
<Data Name="CurrentStatus">0</Data>
</EventData>
</Event>
Jan 14 2020 12:17 PM
Thanks for the new logs and update. I've forwarded them to the dev team and followed up with you more info.
Tanaka
Jun 21 2021 06:47 AM - edited Jun 21 2021 06:49 AM
@Tanaka_Jimha Has there been any word on the progress of this item? Our company has a winforms application that is deployed as MSIX and I noticed this morning that it fails to automatically launch after the update process. I'm testing on Windows 10 21H1
However, Touching the start menu button after about 20 seconds seems to bring it up. I've enclosed the AILog.txt that shows the update was successful. I will also try to run the Feedback Hub application the next time there's an update. Thank you for your time.
Jul 06 2021 11:15 AM
Hi @John_Cote,
I will be reaching out to the team today to see if there has been any updates on this for you. I'll update you once I hear more.
Thank you,
Roy
Aug 04 2021 09:22 AM
@Roy_MacLachlan Jumping into the chain we are also having this same exact issue sporadically. Any updates on a fix?
Oct 14 2021 01:58 AM
@Roy_MacLachlan We have the same problem with our WPF apps.
Oct 15 2021 01:24 AM - edited Oct 15 2021 02:07 AM
@ChreesM I can repro this 100 % of the time with my own MSIX app, just by pointing the .appinstaller file to a different version.
I have found out that the app actually launches, right when the dialog closes, but it becomes a Background process - only visible in the Task Manager.
I believe this is why it is sometimes possible to awaken it by clicking the Start button, searching and so on.
My workaround to this bug is to disable the app from being able to run as a background process at all. Go to Settings -> Background apps to do this.
The dialog closes but the user has to start the app manually. This is also a usability issue because the user is not told they have to start it manually.
Oct 22 2021 05:01 AM
Oct 22 2021 07:47 AM
A bit more info:
XML:
<OnLaunch HoursBetweenUpdateChecks="0" ShowPrompt="true" UpdateBlocksActivation="true"/>
<AutomaticBackgroundTask />
<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
I noticed from reading the documentation that the way App Installer is invoked doesn't seem very deeply integrated with Windows. Supposedly the upgrade check is done only if the taskbar is used to launch the app. If you have e.g. a shortcut on your desktop, and use that, then App Installer doesn't get involved at all. Or if any other process starts your app, same thing, the update check isn't done.
Therefore what seems to be happening is something like this:
This doesn't happen on every code path. If an update check is done but no update is required, the launch works OK (but that might be a timing-caused red herring?).
A workaround is to disable the prompt using ShowPrompt="false" and go to fully silent upgrades i.e. with background upgrades only. This means that if an update has just been released and the user starts their app, it will be the old version and the next start will be upgraded, but, this is only a short window of time as after 8 hours Windows will (supposedly) apply the upgrade in the background anyway. Fully silent upgrades are what Chrome uses so this is an acceptable workaround for now - it is only an issue if the app needs to be forcibly upgraded to match e.g. a protocol change on a server.
In that case the app itself may need to figure out by itself if it's fully up to date or not and if not, restart itself to re-load the updated code - possibly monitoring the AppX logs to figure out when Windows has finished applying the upgrade.