MSFN Forum: changing .js files when transferred to xplode - MSFN Forum

Jump to content



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

changing .js files when transferred to xplode Rate Topic: -----

#1 User is offline   eagle00789 

  • MSFN NutCase
  • PipPip
  • Group: Members
  • Posts: 281
  • Joined: 06-August 04

  Posted 11 August 2004 - 06:50 PM

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)


#2 User is offline   eagle00789 

  • MSFN NutCase
  • PipPip
  • Group: Members
  • Posts: 281
  • Joined: 06-August 04

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 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

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 User is offline   eagle00789 

  • MSFN NutCase
  • PipPip
  • Group: Members
  • Posts: 281
  • Joined: 06-August 04

Posted 11 August 2004 - 07:58 PM

thx. but it took me about an hour to figure this one out

#5 User is offline   big_gie 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 617
  • Joined: 27-July 03

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 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 12 August 2004 - 01:30 PM

This is what I use:

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


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 User is offline   eagle00789 

  • MSFN NutCase
  • PipPip
  • Group: Members
  • Posts: 281
  • Joined: 06-August 04

Posted 12 August 2004 - 05:43 PM

updated to fix an error. see my second post for that

#8 User is offline   big_gie 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 617
  • Joined: 27-July 03

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
  • 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