script error - how to put double quotes within the second parameter of FILE.RUN

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • rachelgeo
    Indigo Rose Customer
    • Jun 2008
    • 4

    script error - how to put double quotes within the second parameter of FILE.RUN

    Hi,

    i wanted the installation of my program to execute regasm.exe to register a .dll file. the dll file is stored in c:\program files\common files folder.

    the syntax of regasm.exe is
    regasm /codebase /tlb "c:\program files\common files\drt.dll"

    in regasm, the source path of dll file should be in double quotes if it contains any space between characters.
    this has created problem for me.

    how do i put double quotes in the second parameter in File.run action?

    if i change the path of dll to c:\rrr\drt.dll and execute the below code, it works perfectly well.

    on post install event, i wrote the following code

    result = File.Run(SessionVar.Expand("%AppFolder%\\regasm.ex e"), "/codebase /tlb C:\\rrr\\drt.dll", "", SW_SHOWNORMAL, true);
    error = Application.GetLastError();
    -- If an error occurred, display the error message.
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    end

    this works. but i want to change the path of my dll file to "c:\program files\common files\drt.dll" .

    what change shud i do in the above code?

    Thanks
  • rachelgeo
    Indigo Rose Customer
    • Jun 2008
    • 4

    #2
    hello again,

    in the above code, i want to use %commonfilesfolder% session variable instead of specifying the path "c:\program files\common files\drt.dll" . directly.

    Comment

    • Ulrich
      Indigo Rose Staff Member
      • Apr 2005
      • 5131

      #3
      Try this:
      Code:
      result = File.Run(SessionVar.Expand("%AppFolder%\\regasm.exe"), "/codebase /tlb \"" .. SessionVar.Expand("%CommonFilesFolder%") .. "\\drt.dll\"", "", SW_SHOWNORMAL, true)
      Ulrich

      Comment

      • AxemanMK
        Forum Member
        • Mar 2006
        • 24

        #4
        In scripting language, you often need to escape some characters in order for the scripting engine to know what you are doing. Characters that often need to be escaped are " \


        example:

        strMyVar = "C:\\Some Directory\\Another Directory";

        Here, the variable value would end up being...

        C:\Some Directory\Another Directory



        Another example:

        strMyVar = "\"C:\\Some Directory\\Another Directory\"";

        Here, the variable value would end up being...

        "C:\Some Directory\Another Directory"



        Another example:

        strMyVar = "1234\"0000\"5678";

        Here, the variable value would end up being...

        1234"0000"5678


        Hope this helps.

        Comment

        • Jason Pate
          Forum Member
          • Jan 2002
          • 328

          #5
          Single quote 'asdfa'

          So if you need the double "in the string". you would do


          Code:
          '/E "C:\\Progam files\\my program\\my program.exe"'
          That would pass

          /e "C:\Progam files\my program\my program.exe" out of lua

          Comment

          Working...
          X