Page 1 of 1

Using square brackets in Write Registry or Create File type

Posted: Sun Aug 30, 2009 7:02 pm
by drewau
Hi Guys,

I'm a bit stumped on an issue our testers have identified with Write Registry and Create File Type commands.
Our software creates a File Association for a couple of exes in the registry. We use a shell verb with a DDE command:

Code: Select all

[Open("%1")]
.

To create the File Association, I used the import feature in design view. When we install the project, the location in the registry where the DDE command should be contains a blank string. If I remove the square brackets and supply

Code: Select all

Open("%1")
the string gets entered into the registry correctly.

The problem is we need the square brackets and I can't seem to find a way to get them to display. I tried to work around the issue by entering the value directly with Write Registry but the same behavior is displayed.

Maybe I have missed something in the help file or is this a issue with Installaware? I'm using IA 9 Studio. I have supplied a test project that replicates the problem.

Regards,

Drew.

File Attached:

My Project1.zip

Posted: Mon Aug 31, 2009 4:02 pm
by neillans
Hi Drew,

It looks like the characters are being stripped in the registry routines; can you give me an idea why you are looking to put the square brackets in a string? I'll get this logged for a fix with the dev team as soon as possible.

Posted: Mon Aug 31, 2009 4:50 pm
by drewau
can you give me an idea why you are looking to put the square brackets in a string?
No sorry, I don't really have a reason, other than this is how it was implemented in our previous Wise install script.
I'll get this logged for a fix with the dev team as soon as possible.
Thanks Andy, that would be appreciated :-)

Re: Using square brackets in Write Registry or Create File t

Posted: Wed Dec 07, 2011 1:47 am
by ulrichard
Did you find a solution to this problem?
I'm facing the same thing right now.
The square brackets seem to be required by the default MFC DDE handler.

Re: Using square brackets in Write Registry or Create File t

Posted: Fri Dec 09, 2011 10:04 pm
by giaviv
Hi,

Please try either:
1. Turning on the Native Engine by setting the NATIVE_ENGINE variable to TRUE
2. Storing the string in a variable and writing it directly as part of the variable

I believe the characters [ and ] should be escaped because they ordinarily denote properties (kind of like variables) in the MSI world.

In an case, here is the proper MSI escape sequence:
[\[]Bracket Text[\]] resolves to [Bracket Text].

Re: Using square brackets in Write Registry or Create File t

Posted: Mon Dec 12, 2011 6:23 am
by ulrichard
Hi giaviv,

thanks for answering.
In the meantime I solved it by using the "WriteRegistryPersist" plugin.

Rgds
Richard