2

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! :-/

Community
  • 1
  • 1
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
  • 1
    Use [`RemoveQuotes`](http://jrsoftware.org/ishelp/topic_isxfunc_removequotes.htm) function. – TLama Oct 12 '13 at 12:11
  • 4
    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 Oct 12 '13 at 21:44

1 Answers1

2

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

You can use RemoveQuotes!

Simple.

Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
  • 1
    It's not hidden at all. Whenever you'll need to find a certain function, go to [`Support Functions Reference`](http://jrsoftware.org/ishelp/topic_scriptfunctions.htm), look for a category you need (in this case *String functions*) and there you can quickly find a function with the *"Quotes"* keyword directly in its name. Don't use Google for that. That help site is not well indexed there, but it doesn't even need to be, if you know it. A similar help with the same content you have shipped with Inno Setup itself, so you don't even go online for those information. – TLama Oct 12 '13 at 12:18
  • 1
    @TLama Yes, I know that *now*! :-P – Chuck Le Butt Oct 12 '13 at 12:32