Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2005
    Posts
    5

    Huh? "hello", said the registry

    My software is using an if statement to see if a certain registry key equals a certain value. It stores the registry's key value in a variable called Def_web. it checks to see if the variable "Def_web" = "E:\Program Files\Internet Explorer\iexplore.exe -nohome" including the quotation marks. But if I enter it as: if (Def_web == ""E:\Program Files\Internet Explorer\iexplore.exe" -nohome" ) it has an error because of the quotation marks.
    What can I do?

    Please Help
    I have been working on this for days to no end...
    and all help is greatly appreciated

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Hi

    You need to escape the two quotation marks so that the scripting engine knows that they are part of the string.

    if (Def_web == "\"E:\Program Files\Internet Explorer\iexplore.exe\" -nohome" )

    Dermot

  3. #3
    Join Date
    Jun 2005
    Posts
    5

    Oh Boy!

    Thanks So Much!!!!

  4. #4
    Join Date
    May 2005
    Posts
    1,115
    backslases are also requred for literal backslashes
    Never know what life is gonna throw at you.
    (Based on a true story.)

  5. #5
    Join Date
    Jun 2005
    Posts
    5

    Huh?

    It still is not working...even with the back slashes

  6. #6
    Join Date
    Jun 2000
    Location
    Indigo Rose Software
    Posts
    1,943
    Try this:

    Code:
    if (Def_web == "\"E:\\Program Files\\Internet Explorer\\iexplore.exe\" -nohome" ) then
    MSI Factory The Next Generation Intelligent Setup Builder

  7. #7
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    What error are you getting? Maybe if you post the complete code we can help. Have you checked the Def_web variable to see what it contains?

    Dialog.Message("Variable Contents", Def_web)

    Dermot

  8. #8
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by Mark
    Try this:

    Code:
    if (Def_web == "\"E:\\Program Files\\Internet Explorer\\iexplore.exe\" -nohome" ) then
    I had thought of this Mark but had assumed that if the value of Def_web was read from the registry it would not have the escape backslashes. Maybe I am wrong.

    Dermot

  9. #9
    Join Date
    Jun 2005
    Posts
    5

    Thumbs down Ohhhhhh Yeah!

    IT WORKED! IT'S WORKING! REJOICE! thank you so so so so so much everbody!

  10. #10
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    So what was the problem? How did you get it to work?

    Dermot

  11. #11
    Join Date
    Jun 2000
    Location
    Indigo Rose Software
    Posts
    1,943
    Quote Originally Posted by Dermot
    I had thought of this Mark but had assumed that if the value of Def_web was read from the registry it would not have the escape backslashes. Maybe I am wrong.
    Well you are partly right, the value read from the registry won't have the escaped backslashes, but the value you compare it against must have the backslashes escaped.

    From the Help file:

    The backslash and quote (\") is known as an escape sequence. An escape sequence is a special sequence of characters that gets converted or “translated” into something else by the script engine. Escape sequences allow you to include things that can’t be typed directly into a string.
    So when the script engine looks at the string it doesn't see the "\\" it just sees "\". If you just pass it one "\" the script engine won't see it, it will read it as an escape sequence.
    MSI Factory The Next Generation Intelligent Setup Builder

  12. #12
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Of course, that makes sense. Don't know what I was thinking of.

    Dermot

Similar Threads

  1. Using registry for bookmarking
    By AXXESS in forum AutoPlay Media Studio 5.0
    Replies: 12
    Last Post: 11-01-2004, 09:22 AM
  2. HOWTO: Merge Registry Keys
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-17-2003, 09:31 AM
  3. Registry Features
    By Dwayne in forum Setup Factory 6.0
    Replies: 1
    Last Post: 02-21-2003, 03:30 AM
  4. INFO: Finding Shell Folders in the Registry
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 03:52 PM
  5. HOWTO: Merge REG Files with the Registry
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-23-2002, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts