When installing or uninstalling a program, this program relies on a custom service, and when the new service file replaces the original, the prompt file is occupied and the operation fails.
This can be resolved at this time, set the file copy flag as follows:
Source: "Usbclerk.exe"; DestDir: "{app}"; Flags:restartreplace Uninsrestartdelete
Source: "JITComVCTK.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "Libwdi.dll"; DestDir: "{app}"; Flags:restartreplace Uninsrestartdelete
After the file copy is complete
[Run]
Filename: "SC"; Parameters: "Stop Usbclerk"; Flags:runhidden
Filename: "{App}\usbclerk.exe"; Parameters: "Uninstall"; Flags:runhidden
This copy of the file when the file is not replaced by the use of files, run the "run" after the service stopped, the system will automatically replace the files you need to replace, uninstall the same can be done.
And a little trick. If you want to include double quotes in double quotes in the Inno installation script, you can param: "" "; the two double quotes in the middle represent a double quotation mark (")