ChiDragon Posted August 3, 2004 Posted August 3, 2004 1) Is there any way besides using a batch to change directories? The reason I ask is that my Jscripts don't seem to allow environment variables in the source paths for the installers that they open, and they're unable to find the installer if I just use the filename without a full path (even though they are in the same directory)... unless I use the CD command. Long and confusing sentence but hopefully it makes some sense.2) Will this syntax work in 1.1.2?<filecopy source='%SYSTEMDRIVE%\Install\Applications\Firefox\plugins\' target='%SYSTEMDRIVE%\Program Files\Mozilla Firefox\plugins\' mask='*.*' />I'm trying it that way instead of doing a directory copy because I don't want to overwrite any files already in that directory.
big_gie Posted August 4, 2004 Posted August 4, 2004 I think he meant the "current directory".Can't you give full paths? You can use environment variables inside JScript:Shell = WScript.CreateObject("WScript.Shell");Environnement_system = Shell.Environment("SYSTEM");Environnement_process = Shell.Environment("PROCESS");Network = WScript.CreateObject("WScript.Network");windir = Environnement_process("SYSTEMROOT")systemdrive = Environnement_process("SYSTEMDRIVE");ProgramFiles = Shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir");SourcePath = Shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath");Nothing really complicated. I use this @ t-12 (cmdlines.txt) and they work fine
ChiDragon Posted August 4, 2004 Author Posted August 4, 2004 Yes, I meant change the current directory.Here is what I did, based on your code:function getWin(win, inc){var cntr = 0;while (!WshShell.AppActivate(win)){if (cntr==12) return true;cntr++;WScript.Sleep(inc);}return true;}var WshShell = new ActiveXObject("WScript.Shell");process = WshShell.Environment("PROCESS");systemdrive = process("SYSTEMDRIVE");var oExec = WshShell.Exec("systemdrive\Install\Codecs\DivX\DivXPro502Bundle.exe");while (oExec.Status == 0){It's still claiming that the system cannot find the file specified even though it's there.
ChiDragon Posted August 4, 2004 Author Posted August 4, 2004 Now this is REALLY screwed... I change the path to the exactly currect full path and it still claims that it can't find it. I copy and paste said path into the explorer bar and it opens fine. I remove the full path and just keep the installer name and it runs fine (but only when testing it in my "\$OEM$\$1\Install\Codecs\DivX", not when I try it with unattended installation from the files copied to the systemdrive).
big_gie Posted August 4, 2004 Posted August 4, 2004 The line:var oExec = WshShell.Exec("systemdrive\Install\Codecs\DivX\DivXPro502Bundle.exe");should be more likevar oExec = WshShell.Exec(systemdrive + "\\Install\\Codecs\\DivX\\DivXPro502Bundle.exe");
ChiDragon Posted August 4, 2004 Author Posted August 4, 2004 Aha, I had also tried that method of splitting up the variable and the rest of the path like that but had neglected to think of double-backslashes. Thanks very much, it's working just fine now.
eagle00789 Posted August 11, 2004 Posted August 11, 2004 Why make it your selve so hard? dont use:var oExec = WshShell.Exec("systemdrive\Install\Codecs\DivX\DivXPro502Bundle.exe");but usevar oExec = WshShell.Exec("%systemroot%\\Install\\Codecs\\DivX\\DivXPro502Bundle.exe");now you can delete the linesprocess = WshShell.Environment("PROCESS");systemdrive = process("SYSTEMDRIVE"); from your script. it's a hel simpler this way
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now