MSFN Forum: Condition Quirk - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Condition Quirk Rate Topic: -----

#1 User is offline   Nazgul 

  • Junior
  • Pip
  • Group: Members
  • Posts: 86
  • Joined: 02-January 05

Posted 07 January 2005 - 02:11 PM

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?


#2 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 07 January 2005 - 02:33 PM

strange.
someone else had this "Írom" problem: here.

I wonder if the cases are somehow related? both are discussing cond[pn].

I don't use cond, so I'm not much help here. maybe hasi knows what's going on...

#3 User is offline   Nazgul 

  • Junior
  • Pip
  • Group: Members
  • Posts: 86
  • Joined: 02-January 05

Posted 07 January 2005 - 02:46 PM

That post is indeed exactly like my problem.

I also get that JavaScript Error Report when exiting after debugging. (Forgot to mention that in the first post)

#4 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 07 January 2005 - 02:56 PM

well, hopefully hasi can make sense out of this.

#5 User is offline   r2k02 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 23-December 04

Posted 08 January 2005 - 03:28 AM

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.

#6 User is offline   Nazgul 

  • Junior
  • Pip
  • Group: Members
  • Posts: 86
  • Joined: 02-January 05

Posted 08 January 2005 - 05:04 AM

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?

#7 User is offline   r2k02 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 23-December 04

Posted 08 January 2005 - 08:07 AM

Hi Nazgul,

You're a better programmer than me. Your modifications seem to solve the problems on my computer as well :thumbup
Bedank voor je hulp!

#8 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 08 January 2005 - 10:29 AM

Probs should be fixed in 3.3.3 available for download now.

#9 User is offline   Nazgul 

  • Junior
  • Pip
  • Group: Members
  • Posts: 86
  • Joined: 02-January 05

Posted 08 January 2005 - 05:29 PM

I just tried version 3.3.3 and it fixed my problems.

Thanks hasi001.

#10 User is offline   poppyq 

  • Newbie
  • Group: Members
  • Posts: 29
  • Joined: 31-May 04
  • OS:none specified
  • Country: Country Flag

Posted 08 January 2005 - 05:38 PM

Is there a file somewhere in the WPI files that says what version you have? I can't seem to find it (maybe I'm blind).

#11 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 09 January 2005 - 03:01 AM

No - there isn't.But you should know, which version you downloaded.

#12 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 09 January 2005 - 10:36 AM

i just include a file called 'WPI Version 3.3.2 (2004-01-06)' (for example) in my WPI folder. I make the file as soon as I extract it, so there is no confusion.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy