Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:39:03+00:00 2026-05-26T13:39:03+00:00

I’m using c#, .net 4, WIX 3.5, Windows Vista. I have made my application

  • 0

I’m using c#, .net 4, WIX 3.5, Windows Vista.
I have made my application compatible with RestartManager by p/invoking the RegisterApplicationRestart method and by handling the WM_QUERYENDSESSION and WM_ENDSESSION window messages (I return new IntPtr(1);).

If I try to update my application manually, then everything works as it should:

  1. Launch application;
  2. Launch msi file containing new app version;
  3. During the installation/update, I’m prompted to close the running application;
  4. Upon continuing the running app is closed, install completes, and the app is restarted;

If I try to update my application from the application itself, then I run into problems:

1) Launch application;
2) Download the new msi file;
3) Launch msi file with:

    using (System.Diagnostics.Process p = new System.Diagnostics.Process())
    {
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.FileName = "msiexec";
        p.StartInfo.Arguments = "/i \"" + downloadPath + "\" /passive";
        p.StartInfo.UserName = "Administrator";
        p.StartInfo.Password = securePassword;
        p.Start();
    }

4) Because I’m using passive mode, the application is closed automatically;
5) After the installation, my application is not restarted and under Event Viewer I have an
Event 10007 – Application or service ‘MyApp’ could not be restarted.

I have tried:

  1. Not to use passive mode for msiexec;
  2. Launch msiexec via cmd.exe (cmd.exe /C “msiexec /i ….”) – in the hopes that launching msiexec from another process would solve the problem;
  3. Wait for 60+ seconds before launching the msi update (shouldn’t be relevant in my scenario, but MSDN documentation has something about it…)

But none of the above has worked (always the same result).

Having to launch the setup with elevated permissions might have something to do with the issue, because during the manual update I get a warning in the Event Viewer – Application MyApp (pid 3220) cannot be restarted – Application SID does not match Conductor SID.
Despite this, restarting the app still works. Googleing the warning yields no good/specific results, only that this warning is probably caused by running the msi in an elevated prompt.

How do I fix (or workaround) this issue, so that I can update my application from the application itself and restart my application afterwards?

Edit – extra testing:

  1. There doesn’t seem to be a need to respond to WM_QUERYENDSESSION and WM_ENDSESSION messages, because application restart during a manual upgrade works without them, so we can rule them out;
  2. If I don’t provide administrator credentials to the application initiated upgrade and instead I type them in during the upgrade, then app restarting works;
  3. If I run an elevated command prompt and initiate an application upgrade from there (manually), then app restarting still works;
  4. In order for application upgrade to work at all under Standard user accounts (so far I tested under an Administrator account with UAC), then I also have to set p.StartInfo.LoadUserProfile = true;. Otherwise nothing happens. (application restart still doesn’t work though);
  5. I tried all other process StartInfo parameters that I could set – WorkingDirectory, Redirect, Verb
    (= “runas”) – no change in results;
  6. I installed Vista SP2 onto the virtual machine that I have been testing on (so far ran SP1), but no change;
  7. I performed an “automatic” application upgrade with verbose logging. In the end there was an error message – RESTART MANAGER: Failed while restarting applications. Error: 352. That error code is very generic (http://msdn.microsoft.com/cs-cz/library/aa373665), inorder to get more detailed info I would have to write my own installer that would call RmGetList after the error, then I might get more details (this though is something I’m not willing to do);

Edit 2 – msi log file:
http://mommi.planet.ee/muu/log.txt

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:39:04+00:00Added an answer on May 26, 2026 at 1:39 pm

    Assuming that the manual process indeed works without any problem it seems that your need for Administrator privileges in combination with the “updating itself” leads to these problems. I see the following options:

    • create a batch file to execute the update
      When you want to update call this batch file (with elevated privileges), make the app close itself… the batch file should wait some seconds, then check whether the app is still running (and close it in case) and then run the commandline you need to run msiexec – don’t restart the app from within msiexec but after a successfull run of msiexec from the batch file.

    • create a batch file which is always used to start the app
      When the time comes to update you just end the app. Either the batch file check for an available update and applies it, starting the app after successfull update OR the app set some environment variable which is then accordingly processed by the rest of the batch file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.