PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Brian Chirgwin on September 08, 2010, 02:42:17 AM

Title: ampersand in version resources causes error
Post by: Brian Chirgwin on September 08, 2010, 02:42:17 AM

It would be nice if FireFly warned you if an & exists in the version information.

Error:

Adding and & to the description in the file resource causes an error with the following results:

Running in FF with compile and run F5 the application doesn't seem to run. No message box.

executing the compiled exe from windows explorer window presents the message "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the issue."
Title: Re: ampersand in version resources causes error
Post by: Paul Squires on September 08, 2010, 09:19:09 AM
Hi Brian,

I updated the code to test for a variety of "bad characters". You will get an error message if any of these characters are in your version fields:

*^/\+=<>!~`@#$%&():;,.[]{}| and double quote

I can't seem to find a definitive list of characters that need to be excluded.... anyone else here know of a list?




Title: Re: ampersand in version resources causes error
Post by: Roger Garstang on September 08, 2010, 01:42:39 PM
Backslash needs to be available to include copyright symbols and such.  Last I remember talking about resources was in http://www.planetsquires.com/protect/forum/index.php?topic=2252  but the link there is mostly for naming the values.  You pretty much block every symbol in what you have.  I'd almost filter in reverse and allow alphanumeric, space, period, comma, !, ?, and backslash unless they cause issues.  There may be others in the list that don't make problems too.  As well as other symbols on foreign keyboards that could cause problems.
Title: Re: ampersand in version resources causes error
Post by: Paul Squires on September 08, 2010, 02:01:56 PM
I'll play around with each of the symbols and see which ones cause the problem and which ones do not. Eventually, we'll come up with a more or less complete list of unacceptable characters.
Title: Re: ampersand in version resources causes error
Post by: Paul Squires on September 08, 2010, 02:08:39 PM
Looks like the ampersand and double quotes are the two offending characters that I need to tets for.
Title: Re: ampersand in version resources causes error
Post by: Roger Garstang on September 08, 2010, 07:31:27 PM
Sounds good to me.  I usually use \251 for Copyright symbol...saw it in one of the forum threads some time back.  Not sure what charset that is though as most use 169 and either seem to work.  It would be cool for some buttons to insert common symbol codes on that screen too.
Title: Re: ampersand in version resources causes error
Post by: Cho Sing Kum on September 09, 2010, 01:56:52 AM
I am not sure that I understand the issue here with the "&" character.

As a test, I used Tom & Jerry in the Company Name field
and
Copyright © 2010, Tom & Jerry in the Copyrights field.

Both compiled and run okay. Is this the same or different from the issue?

I will need the "&" and "©" in the same fields in my actual work.
Title: Re: ampersand in version resources causes error
Post by: Paul Squires on September 09, 2010, 08:38:40 AM
Hi Cho,

I did some more testing and there are two fields that do not like the & or double quotes:

File Description
Product Name

The other fields seem to compile and run okay with those characters embedded. Weird. I'll have to modify the FF3 code again.
Title: Re: ampersand in version resources causes error
Post by: Cho Sing Kum on September 09, 2010, 11:48:47 AM
Thanks, Paul.
Title: Re: ampersand in version resources causes error
Post by: Roger Garstang on September 09, 2010, 11:58:53 AM
I can see the quotes possibly causing issues in any field.  The & is interesting though.  File Desc says it may be presented in a Listbox, so maybe it is filtered on what is allowed.