I know, the topic title is a bit wierd in this forum, but:
I just changed all my batchfiles so that i use only .js-files and XPlode. The problem i have now, is this: I run all the installations from the cd, but to succesfull run a few installations, i made a .js wrapper around it. these .js-files run the actual installer. in those .js files are still paths to %systemroot%. what variabele do i have to use, so that it will look in the correct folder on the cd.
(i already posted this in the xplode forum part, but i just reported that post, as i think it doesn't belong there)
Page 1 of 1
changing .js files when transferred to xplode
#2
Posted 11 August 2004 - 07:43 PM
I'm going to answer my own question again. Just put this at the top of any .js-file to let it see your cdrom.
thisDrive = WScript.ScriptFullName; thisDrive = thisDrive.substr(0,3);the variable thisDrive wil contain something like "d:\" then use it like thisDrive + "the rest of the path"
#3
Posted 11 August 2004 - 07:52 PM
OK, so now a method to access CD directly from JS - nice addition to the perpetually growing base of knowledge here.
#4
Posted 11 August 2004 - 07:58 PM
thx. but it took me about an hour to figure this one out
#5
Posted 12 August 2004 - 07:18 AM
I have plenty of those variables. I'm at work right now so maybe this evning I'll post all I have.
#6
Posted 12 August 2004 - 01:30 PM
This is what I use:
No matter where your JS is, it will read the first two letters, i.e. C:, D:, and so on.
No matter your JS is on HD or CD. I mean, you no longer need to use %systemdrive% if you install from your HD, either.
winamp.js said:
var WshShell = WScript.CreateObject ("WScript.Shell");
var path = WScript.ScriptFullName;//getting the path to this script
var CDROM = path.substring(0,2);//extracting (DriveLetter:) from the path
WshShell.RUN (CDROM + "\\Install\\Winamp\\winamp.exe");//running exe
WScript.Sleep(3000);//time needed by installer to extract its files
WshShell.AppActivate("Winamp Setup");//name of setup screen
var path = WScript.ScriptFullName;//getting the path to this script
var CDROM = path.substring(0,2);//extracting (DriveLetter:) from the path
WshShell.RUN (CDROM + "\\Install\\Winamp\\winamp.exe");//running exe
WScript.Sleep(3000);//time needed by installer to extract its files
WshShell.AppActivate("Winamp Setup");//name of setup screen
No matter where your JS is, it will read the first two letters, i.e. C:, D:, and so on.
No matter your JS is on HD or CD. I mean, you no longer need to use %systemdrive% if you install from your HD, either.
#7
Posted 12 August 2004 - 05:43 PM
updated to fix an error. see my second post for that
#8
Posted 13 August 2004 - 09:41 AM
These are the one I use:
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");
UserProfile = Environnement_process("USERPROFILE");
UserProfileTous = Environnement_process("ALLUSERSPROFILE");
DefaultUserProfile = systemdrive + "\\Documents and Settings\\Default User\\";
QuickLaunch = UserProfile + "\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch\\";
MenuDemarrer = UserProfile + "\\Menu Démarrer\\Programmes\\";
Bureau = UserProfile + "\\Bureau\\";
QuickLaunchTous = UserProfileTous + "\\Application Data\\Microsoft\\Internet Explorer\\Quick Launch\\";
MenuDemarrerTous = UserProfileTous + "\\Menu Démarrer\\Programmes\\";
BureauTous = UserProfileTous + "\\Bureau\\";
path = WScript.ScriptFullName;
path = path.substr(0,path.lastIndexOf("\\")+1);
// Variable RunOnceEx
RunOnceEx = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx";
DefaultRunOnce = "HKEY_USERS\\.DEFAULT\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce";
RunOnce = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce";
Utilisateur = Network.UserName;
Ordinateur = Network.ComputerName;
Share this topic:
Page 1 of 1



Help

Back to top









