You are here

[Closed] PAL - ${SetEnvironmentVariablesPath} cannot accept a string with a " in a parameter

6 posts / 0 new
Last post
The MAZZTer
The MAZZTer's picture
Offline
Last seen: 1 year 3 months ago
Developer
Joined: 2006-11-17 15:31
[Closed] PAL - ${SetEnvironmentVariablesPath} cannot accept a string with a " in a parameter

In said macro, we see this:

Push "${_VARIABLE_NAME}"
Push "${_PATH}"

This results in Push believing it has multiple parameters due to the " being interpreted as an end string. It needs to be escaped somehow or something.

My band-aid fix was to do this to my local copy:

Push `${_VARIABLE_NAME}`
Push `${_PATH}`

Obviously the same problem, just less likely to run into it due to the uncommon use of the backtick character. Any other macros in PAL may suffer from the same problem.

Example that illustrates this problem:

${SetEnvironmentVariablesPath} CACHEDIR '--disk-cache-dir="$TempDirectory" '

[Closed; workaround exists and root problem cannot be solved - mod Chris]

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Alternative workaround
StrCpy $0 `--disk-cache-dir="$TempDirectory" `
${SetEnvironmentVariablesPath} CACHEDIR $0

This is a much better fix than patching PAL itself, something you shouldn't ever do because it stops other people from using it successfully.

There is no way of fixing it completely while we're doing it in NSIS. The design of its macro system precludes any complete solution entirely. However, I think we may as well change " to `.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Unnecessary

IRC
[...] use a NSIS variable and StrCpy it to $ExecString on ${PreExec}.

Previously known as kAlug.

The MAZZTer
The MAZZTer's picture
Offline
Last seen: 1 year 3 months ago
Developer
Joined: 2006-11-17 15:31
Turns out Iron Portable,

Turns out Iron Portable, which I was using as a base, did the EXACT SAME THING you told me to do, about 4-5 times over. Woohoo, go me.

Thanks. Smile

Signature automatically removed for being too awesome.

The MAZZTer
The MAZZTer's picture
Offline
Last seen: 1 year 3 months ago
Developer
Joined: 2006-11-17 15:31
Yeah I wasn't sure if copying

Yeah I wasn't sure if copying it to a string first would help. My instincts told me it wouldn't, guess I should've tried it.

The solution I got from IRC (above) was much simpler, thankfully.

Signature automatically removed for being too awesome.

vf2nsr
vf2nsr's picture
Offline
Last seen: 7 years 6 months ago
Developer
Joined: 2010-02-13 17:10
So this

can be marked as resolved?

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Log in or register to post comments