Installation 如何在inno安装程序的ShellExec()中使用/SILENT选项

Installation 如何在inno安装程序的ShellExec()中使用/SILENT选项,installation,inno-setup,uninstallation,silent,silent-installer,Installation,Inno Setup,Uninstallation,Silent,Silent Installer,我正在使用ShellExec卸载安装程序中的应用程序。我希望ShellExec在没有用户交互的情况下安静地工作 这是我的密码: procedure UninstallMyApp; var ErrorCode: Integer; begin ShellExec('runas', 'rundll32.exe', 'dfshim.dll,ShArpMaintain MyApp.application, Culture=neutral, PublicKeyToken=0000000000

我正在使用ShellExec卸载安装程序中的应用程序。我希望ShellExec在没有用户交互的情况下安静地工作

这是我的密码:

procedure UninstallMyApp;
var
  ErrorCode: Integer;
  begin
    ShellExec('runas', 'rundll32.exe', 'dfshim.dll,ShArpMaintain MyApp.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=x86', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);                   
  end;

/S、/qn、/SILENT用于静默安装,但在这里我很困惑,如何在此代码中添加/SILENT选项?

@RobeN,我没有在命令行中运行它。尽管有软件隐藏,但它使用用户交互。不完全是UAC弹出窗口,它只是询问用户是否卸载?如果用户按“确定”,它将被卸载,如果用户按“取消”,它将不会卸载。@RobeN,这与rundll32无关。它是关于传递给被调用的dfshim.dll入口点的lpszCmdLine参数的内容。如果ClickOnce DLL接口不支持这样的参数,那么你就不走运了。如果将SW_HIDE传递给ShellExec函数,或传递给入口点的nCmdShow参数,则只需隐藏问题,即可隐藏请求用户确认的对话框。您需要确认该对话框,或者更好的是,找到一个执行静默卸载的参数,该参数不存在。因为我对C不太了解,有人能告诉我,这个选项是什么意思吗'dfshim.dll,SharpMaintent MyApp.application,Culture=neutral,PublicKeyToken=0000000000000000,processorArchitecture=x86',SW_HIDE,EWWaitUnterminated,ErrorCode?它与C无关。它字面上的意思是,通过rundll32.exe Windows应用程序,您正在执行ClickOnce DLL的dfshim.DLL函数SharpMaintent,并将命令MyApp.application、Culture=neutral、PublicKeyToken=0000000000000000、processorArchitecture=x86传递给它。该函数本身必须支持静默卸载,否则您将只隐藏确认对话框。你需要告诉那个函数,嘿,不要显示那个对话框,只需卸载我想要的,但这很可能是它缺少的。