Source language: Translate to:

Why does [TempDir] work the same as [PubDir]?

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Why does [TempDir] work the same as [PubDir]?

Postby tjchan » Tue Jan 09, 2007 9:26 am

I've been trying to get some code done. And when looking at the variables [TempDir] and [PubDir] look right when displayed.

Yet, when I start doing things with extract (from both test run mode and compiled pub), it seems like [TempDir] and [PubDir] are being treated synonymously.

Code: Select all
ExtractFile "C:\Activation Project\IZARCE.exe" "[TempDir]IZARCE.exe"
Run "[TempDir]IZARCE.exe" "-e myarchive.zip" "RunOnce+Wait+LoadComplete+Minimized+Hidden" "" ""
FileExists "[TempDir]IZARCE.exe" "[Fileok]"
If "[Fileok]" "=" "true"
  FileErase "[TempDir]IZARCE.exe"


However, when this is executed, it does not go to:
c:\Documents and Settings\Compaq_Owner\Local Settings\Temp as expected.

It does the extraction in my Pub's directory c:\Activation Project

Any ideas why it is doing this?

Thanks!
-Timothy
tjchan
 
Posts: 70
Joined: Thu Mar 31, 2005 11:02 pm
Location: Dallas, TX

Postby Sam Cox » Tue Jan 09, 2007 9:59 am

Try this:
Code: Select all
ExtractFile "C:\Activation Project\IZARCE.exe" "[TempDir]"

in which only the directory is specified as the extract command's destination.
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby Gaev » Tue Jan 09, 2007 10:17 am

Timothy:

I tried this ...
Code: Select all
Alertbox "PubDir ..." "[PubDir]"
Alertbox "TempDir ..." "[TempDir]"
FileOpenBox "TempDir ..." "*.txt" "[TempDir]" "[junk]" ""
ExtractFile "c:\gk\answer.txt" "[TempDir]answer.txt"
FileOpenBox "TempDir ..." "*.txt" "[TempDir]" "[junk]" ""
... and everything worked as expected.

The problem might be with the Run command ... try ...
Code: Select all
SetVar "[myProg]" "![TempDir]IZARCE.exe"
Run "[myProg]" "-e myarchive.zip" "RunOnce+Wait+LoadComplete+Minimized+Hidden" "" ""
... also, insert a FileOpenBox command after the ExtractFile command to see that it does place the file in the [TempDir] folder.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby tjchan » Tue Jan 09, 2007 6:51 pm

Thanks! I'll give this a shot!
tjchan
 
Posts: 70
Joined: Thu Mar 31, 2005 11:02 pm
Location: Dallas, TX

Postby tjchan » Fri Jan 12, 2007 3:30 pm

Thanks Sam and Gaev.

Sam's solution worked fine for me.
tjchan
 
Posts: 70
Joined: Thu Mar 31, 2005 11:02 pm
Location: Dallas, TX


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest