Search code examples
c#c++c++-clicommand-line-interfacewindows-installer

Customize msiexec progress bar?


My application call msiexec to run uninstall.

   logger->LogDebug("Actions: MsiUninstallExec()!");
    System::Diagnostics::Process ^p = gcnew System::Diagnostics::Process();
    p->StartInfo->FileName = "msiexec";
    p->StartInfo->Arguments = "/x " + AppSetting::ProductCode;
    p->Start();
/// -->>> Uninstall
/// -->> Choose restart or not.
/// -->>> Application Exit

When uninstallation is done, users have to choose restart or not to complete this process. But my customer request : "The progress bar of msiexec must move to the last (right end)." How to edit it ? Do you have any idea for me?

enter image description here


Solution

  • Suggestion: You can try something like this (find product GUID):

    msiexec.exe /X {PRODUCT-GUID} /QN REBOOT=ReallySuppress /L*V "C:\Temp\msilog.log" 
    

    Quick command line explanation:

     /X {PRODUCT-GUID}          = run uninstall sequence for specified product 
     /QN                        = run completely silently
     /REBOOT=ReallySuppress     = suppress reboot prompts
     /L*V "C:\Temp\msilog.log"  = verbose logging at specified path
    

    Alternatives: There are many ways to invoke MSI uninstall: Uninstalling an MSI file from the command line without using msiexec. You can uninstall via: msiexec, ARP, WMI, PowerShell, deployment Systems such as SCCM, VBScript / COM Automation, DTF, or via hidden Windows cache folders, and a few other options.


    msiexec.exe: There are two flavors of the msiexec.exe command line. An original one and a later one that added the "full word" switches such as /quiet and /noreboot and the likes. The original command line used /qn as the switch for silent mode. Here are links to both flavors: MSIEXEC what is the difference between qn and quiet.


    Some Links: