问题
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