eagle00789 Posted August 12, 2004 Posted August 12, 2004 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)
eagle00789 Posted August 12, 2004 Author Posted August 12, 2004 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"
prathapml Posted August 12, 2004 Posted August 12, 2004 OK, so now a method to access CD directly from JS - nice addition to the perpetually growing base of knowledge here.
eagle00789 Posted August 12, 2004 Author Posted August 12, 2004 thx. but it took me about an hour to figure this one out
big_gie Posted August 12, 2004 Posted August 12, 2004 I have plenty of those variables. I'm at work right now so maybe this evning I'll post all I have.
mazin Posted August 12, 2004 Posted August 12, 2004 This is what I use:var WshShell = WScript.CreateObject ("WScript.Shell");var path = WScript.ScriptFullName;//getting the path to this scriptvar CDROM = path.substring(0,2);//extracting (DriveLetter:) from the pathWshShell.RUN (CDROM + "\\Install\\Winamp\\winamp.exe");//running exeWScript.Sleep(3000);//time needed by installer to extract its filesWshShell.AppActivate("Winamp Setup");//name of setup screenNo 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.
eagle00789 Posted August 12, 2004 Author Posted August 12, 2004 updated to fix an error. see my second post for that
big_gie Posted August 13, 2004 Posted August 13, 2004 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 RunOnceExRunOnceEx = "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;
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