1
votes

I have a string, "c:\windows\unins000.exe", that I need to turn into, c:\windows\unins000.exe. It would be easy enough to do in another language, but I need to do it in Inno Setup/Pascal.

The problem I'm having is that I get an "invalid directory" error when I run

Exec(UninstallString, '/SILENT', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)

with the above string, and it appears that it's the quotation marks that are causing the problem.

I can't even find an example of ANY string functions in Pascal or Inno Setup! :-/

1
Use RemoveQuotes function. - TLama
Note that you don't actually need to remove the quotes from that string. Use Exec('', UninstallString + ' /SILENT', ...) instead. (Or just fetch the QuietUninstallString, which already has /SILENT in it.) - Miral
Thanks for the tip, Miral. - Chuck Le Butt

1 Answers

1
votes

Aha! I found it hidden away in the manual. Google wasn't being too helpful today.

You can use RemoveQuotes!

Simple.