Jump to content

Condition Quirk


Recommended Posts

I'm having some issues using Conditions.

I've added 2 programs through Config which have the following conditions:

1: FileExists("%cdrom%\Installers\Microsoft .Net Framework 1.1 Incl SP1\netfx.msi") && FileExists("%cdrom%\Installers\Microsoft .Net Framework 1.1 Incl SP1\NDP1.1sp1-KB867460-X86.exe")

2: FileExists("%cdrom%\Installers\Daemon Tools 3.47\Daemon Tools 3.47.msi") && !FileExists("%programfiles%\D-Tools\Daemon.exe")

Because all 4 files exist, I expect the first condition to succeed and the second to fail. This is confirmed for me when the Framework checkbox is rendered and the Daemon Tools one isn't.

But when I press install both conditions fail, as can be seen in the debug output below.

DEBUG:
Working on Windows XP
Categories: | System Tools | Office | Tools | PowerToys |
SortPrograms running
SortPrograms finished
Winheight: 768 - Computed 3 columns - Using max. 3 columns with a column-width of 33%
Dependencies: |
Rendering of boxes started
 Found CDROM as folder C:\
 Condition failed: FileExists("C:\\Installers\\Daemon Tools 3.47\\Daemon Tools 3.47.msi") && !FileExists("C:\\Program Files\\D-Tools\\Daemon.exe") -- not rendering Daemon Tools 3.47
Rendering of boxes finished
Applying checks: default
Testing condition: FileExists("Írom%\Installers\Microsoft .Net Framework 1.1 Incl SP1\netfx.msi") && FileExists("Írom%\Installers\Microsoft .Net Framework 1.1 Incl SP1\NDP1.1sp1-KB867460-X86.exe")
Condition failed -- skipping .Net Framework 1.1 Incl. SP1
Testing condition: FileExists("Írom%\Installers\Daemon Tools 3.47\Daemon Tools 3.47.msi") && !FileExists("%programfiles%\D-Tools\Daemon.exe")
Condition failed -- skipping Daemon Tools 3.47
Sort
Installing...

I did notice that the debug window shows Írom% where I would be expecting %cdrom%, but I can't figure out what's causing it, or if it's even relevant.

Could somebody tell me what I'm doing wrong here?

Link to comment
Share on other sites


I reported the same problem and a place where the fix should be implemented here (2nd post from the bottom).

We only have to wait for hasi001 as it seems he's having a real live now :) I someone else is capable of looking at javascript, please do. This seems to be my last problem before I can burn and do some real installations instead of testing in VMware.

Link to comment
Share on other sites

After reading your post in the other topic I decided to take a look at the pieces of code you mentioned in boxes.js and generate.js. I got everything to work by modifying the following pieces of code in generate.js.

if(!eval(replpath(unescape(cond[i])).replace(/\\/g, "\\\\"))) {

into

var c = unescape(replpath(cond[i][0]).replace(/\\/g, "\\\\"));
if(!eval(c)) {

if(!eval(replpath(unescape(programs[i].cond)).replace(/\\/g, "\\\\"))) {

into

var c = unescape(replpath(programs[i].cond + "").replace(/\\/g, "\\\\"));
if(!eval(c)) {

The debug window still shows those weird "Írom" things (which are caused by the unescape function by the way) but everything now works as it should.

I've also made a small workaround for the JavaScript report I was getting on exit. This code has to be changed at line 16 of generate.js.

WshShell.regDelete(KeyBase);

into

try {
   WshShell.regDelete(KeyBase);
} catch (b) {
   debug("Problem on deleting RegKey '" + KeyBase + "': " + b.message,1);
}

Maybe somebody else can test this as well?

And if its good enough maybe hasi001 would be kind enough to put it in the official version?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...