Customize msiexec progress bar?

℡╲_俬逩灬. 提交于 2019-12-11 13:26:32

问题


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?


回答1:


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:

  • Silent installation of a MSI package
  • How can I find the product GUID of an installed MSI setup?
  • How to report msi installation status on quiet install



回答2:


msiexec /passive /x ProductCode

This should give you just the ProgressBar UI. You can also ask the user whether they want to skip restart or always force restart when the Uninstall completes. Then can add the /norestart or /forcerestart option appropriately.



来源:https://stackoverflow.com/questions/52400640/customize-msiexec-progress-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!