Re: [ROOT] InstallShield win9x/NT/2000 ROOTSYS/path code

From: Valery Fine (fine@bnl.gov)
Date: Thu Feb 15 2001 - 06:39:25 MET


> 
> InstallShield code below will set ROOTSYS and PATH on win9x/NT/200. I am
> runnning win98, so you have to check it on NT/2000. If it works for a local
> user on NT, I can add "administrator on-line" check and if it is so, install
> ROOT for all users on this comp.
> 
> There is a problem with ROOTSYS and long/short names in autoexec.bat on
> win9x. Paths should be "short" in the .bat file, i.e. autoexec.bat can not
> recognize
> 
> SET ROOTSYS = C:\Program Files\ROOT
> 
> Instead you have to write
> 
> SET ROOTSYS= C:\Progra~1\ROOT
> 
> and the same in the PATH.
> 
> On the other hand ROOT doesn't understand
> 
> ROOTSYS= C:\Progra~1\ROOT
> 

I think the compromise solution for Win9x would be 

PATH = C:\Progra~1\ROOT; %PATH%
set ROOTSYS =  C:\Program Files\ROOT

This is what InstallShield can provide.

 Another compromise solution is to use the root.bat file to star root rather root.exe
That root.bat may look as follows:

root.bat:

set rootsys=c:\Program file\root
path=c:\progra~1\root;%path%
command /k root_exe.exe %1 %2 %3 %4 %6 %7 %8 %9

To avoid a conflict I may offer renaming the root.exe to root_exe.exe.
(In my mind the first versions of ROOT were supplied with such batch file)
Such "root.bat" can be provided via root distribution. However this still needs
some manual intervention, namely one has to increase the volume of MS DOS
memory allocated for the env. variables up to 4K via MS DOS prompt "Properties".

In fact the right solution for any Windows flavor is to avoid env.variables 
(ROOTSYS / Home /Path) at all and use the registry entries directly like
the "normal" Windows application does.
This will eliminate the mess we have been dealing with for the MS DOS 
based Win 9x family and for the future MS system as well, and allow to 
customize the ROOT parameters "per user" /"per session" / "per version"
etc. with no problem.

                Valeri

  Regards,
                 Valeri






> Regards,
> Anton
> 
> 
> 
>     // your global variables
> 
>   #define WM_WININICHANGE 0x001A
>   #define HWND_BROADCAST 0xffff
> 
> 
> function OnFirstUIAfter()
>     STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
>     STRING szROOTSYS, szKey, szEnv;
>     NUMBER bOpt1, bOpt2;
>     POINTER pEnv;
> 
> begin
> 
>     if (GetEnvVar ("ROOTSYS", szROOTSYS) < 0) then
> 
>       if (SYSINFO.WIN9X.bWin9X) then
> 
> //        MessageBox ("WIN 9x detected", INFORMATION);
> 
>         BatchFileLoad("");
> 
>         szROOTSYS = TARGETDIR;
> 
>         if (BatchAdd("ROOTSYS", szROOTSYS, "PATH", BEFORE) < 0) then
>           MessageBox ("Setting ROOTSYS failed", INFORMATION);
>         endif;
> 
>         LongPathToShortPath(szROOTSYS);
> 
>         if (BatchAdd ("PATH", szROOTSYS+"\\bin;%PATH%", "PATH", AFTER) < 0)
> then
>           MessageBox ("Setting ROOT PATH failed", INFORMATION);
>         endif;
> 
>         BatchFileSave("AUTOEXEC.OLD");
> 
>         BATCH_INSTALL = TRUE;
>       endif;
> 
>       if (SYSINFO.WINNT.bWinNT || SYSINFO.WINNT.bWin2000) then
> 
> //        MessageBox ("WIN NT/2000 detected", INFORMATION);
> 
>         szKey="Environment";
>         RegDBSetDefaultRoot(HKEY_CURRENT_USER);
>         RegDBSetKeyValueEx(szKey,"ROOTSYS",REGDB_STRING,TARGETDIR,-1);
> 
>         szEnv = "Environment";
>         pEnv = &szEnv;
>         SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
> 
>       endif;
> 
>     endif;
> 
> 
>     Disable(STATUSEX);
> 
>     ShowObjWizardPages(NEXT);
> 
>  bOpt1  = FALSE;
>     bOpt2  = FALSE;
>     szMsg1 = "RQuant installation successfully finished!" +
>              "\n\nYour system.rootrc file has been copied to
> system.rootrc.old"; // SdLoadString(IFX_SDFINISH_MSG1);
>     SdFinishEx(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2);
> end;
> 
> 
> http://www.smartquant.com
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:36 MET