Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Adding Environment Variables+classpath


4 replies to this topic

earn

earn
  • Members
  • 5 posts

Posted 03 October 2005 - 11:24

i have installshield 6 and windows xp

i have the setup.rul
this is code

// Include header file
#include "sdlang.h"
#include "sddialog.h"

////////////////////// string defines ////////////////////////////

#define UNINST_LOGFILE_NAME "Uninst.isu"

//////////////////// installation declarations ///////////////////

// ----- DLL prototypes -----


// your DLL prototypes


// ---- script prototypes -----

// generated
prototype ShowDialogs();
prototype MoveFileData();
prototype HandleMoveDataError( NUMBER );
prototype ProcessBeforeDataMove();
prototype ProcessAfterDataMove();
prototype SetupRegistry();
prototype SetupFolders();
prototype CleanUpInstall();
prototype SetupInstall();
prototype SetupScreen();
prototype CheckRequirements();
prototype DialogShowSdWelcome();
prototype DialogShowSdFinishReboot();

// your prototypes


// ----- global variables ------

// generated
BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
STRING svDir;
STRING svName, svCompany, svSerial;
STRING szAppPath;
STRING svSetupType;


// your global variables


///////////////////////////////////////////////////////////////////////////////
//
// MAIN PROGRAM
//
// The setup begins here by hiding the visible setup
// window. This is done to allow all the titles, images, etc. to
// be established before showing the main window. The following
// logic then performs the setup in a series of steps.
//
///////////////////////////////////////////////////////////////////////////////
program
Disable( BACKGROUND );

CheckRequirements();

SetupInstall();

SetupScreen();

if (ShowDialogs()<0) goto end_install;

if (ProcessBeforeDataMove()<0) goto end_install;

if (MoveFileData()<0) goto end_install;

if (ProcessAfterDataMove()<0) goto end_install;

if (SetupRegistry()<0) goto end_install;

if (SetupFolders()<0) goto end_install;


end_install:

CleanUpInstall();

// If an unrecoverable error occurred, clean up the partial installation.
// Otherwise, exit normally.

if (bInstallAborted) then
abort;
endif;

endprogram

///////////////////////////////////////////////////////////////////////////////
// //
// Function: ShowDialogs //
// //
// Purpose: This function manages the display and navigation //
// the standard dialogs that exist in a setup. //
// //
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
NUMBER nResult;
begin

Dlg_Start:
// beginning of dialogs label

Dlg_SdWelcome:
nResult = DialogShowSdWelcome();
if (nResult = BACK) goto Dlg_Start;

return 0;

end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessBeforeDataMove //
// //
// Purpose: This function performs any necessary operations prior to the //
// actual data move operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
STRING svLogFile;
NUMBER nResult;
begin

InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );

svLogFile = UNINST_LOGFILE_NAME;

nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
if (nResult < 0) then
MessageBox( @ERROR_UNINSTSETUP, WARNING );
endif;

szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir

if ((bIs32BitSetup) && (bIsShellExplorer)) then
RegDBSetItem( REGDB_APPPATH, szAppPath );
RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
endif;

// TODO : update any items you want to process before moving the data
//

return 0;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: MoveFileData //
// //
// Purpose: This function handles the data movement for //
// the setup. //
// //
///////////////////////////////////////////////////////////////////////////////
function MoveFileData()
NUMBER nResult, nDisk;
begin

nDisk = 1;
SetStatusWindow( 0, "" );
Disable( DIALOGCACHE );
Enable( STATUS );
StatusUpdate( ON, 100 );
nResult = ComponentMoveData( MEDIA, nDisk, 0 );

HandleMoveDataError( nResult );

Disable( STATUS );

return nResult;

end;


///////////////////////////////////////////////////////////////////////////////
// //
// Function: HandleMoveDataError //
// //
// Purpose: This function handles the error (if any) during the move data //
// operation. //
// //
///////////////////////////////////////////////////////////////////////////////
function HandleMoveDataError( nResult )
STRING szErrMsg, svComponent , svFileGroup , svFile;
begin

svComponent = "";
svFileGroup = "";
svFile = "";

switch (nResult)
case 0:
return 0;
default:
ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
szErrMsg = @ERROR_MOVEDATA + "\n\n" +
@ERROR_COMPONENT + " " + svComponent + "\n" +
@ERROR_FILEGROUP + " " + svFileGroup + "\n" +
@ERROR_FILE + " " + svFile;
SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
bInstallAborted = TRUE;
return nResult;
endswitch;

end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: ProcessAfterDataMove //
// //
// Purpose: This function performs any necessary operations needed after //
// all data has been moved. //
// //
///////////////////////////////////////////////////////////////////////////////
function ProcessAfterDataMove()
begin

// TODO : update self-registered files and other processes that
// should be performed after the data has been moved.


return 0;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupRegistry //
// //
// Purpose: This function makes the registry entries for this setup. //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupRegistry()
NUMBER nResult;

begin

// TODO : Add all your registry entry keys here
//
//
// RegDBCreateKeyEx, RegDBSetKeyValueEx....
//

nResult = CreateRegistrySet( "" );

return nResult;
end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupFolders
//
// Purpose: This function creates all the folders and shortcuts for the
// setup. This includes program groups and items for Windows 3.1.
//
///////////////////////////////////////////////////////////////////////////////
function SetupFolders()
NUMBER nResult;

begin


// TODO : Add all your folder (program group) along with shortcuts (program items)
//
//
// CreateProgramFolder, AddFolderIcon....
//

nResult = CreateShellObjects( "" );

return nResult;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: CleanUpInstall //
// //
// Purpose: This cleans up the setup. Anything that should //
// be released or deleted at the end of the setup should //
// be done here. //
// //
///////////////////////////////////////////////////////////////////////////////
function CleanUpInstall()
begin


if (bInstallAborted) then
return 0;
endif;

DialogShowSdFinishReboot();

if (BATCH_INSTALL) then // ensure locked files are properly written
CommitSharedFiles(0);
endif;

return 0;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupInstall //
// //
// Purpose: This will setup the installation. Any general initialization //
// needed for the installation should be performed here. //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupInstall()
begin

Enable( CORECOMPONENTHANDLING );

bInstallAborted = FALSE;


svDir="c:\\j7";

TARGETDIR = svDir;

SdProductName( @PRODUCT_NAME );

Enable( DIALOGCACHE );

return 0;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: SetupScreen //
// //
// Purpose: This function establishes the screen look. This includes //
// colors, fonts, and text to be displayed. //
// //
///////////////////////////////////////////////////////////////////////////////
function SetupScreen()
begin

Enable( FULLWINDOWMODE );
Enable( INDVFILESTATUS );
SetTitle( @TITLE_MAIN, 24, WHITE );

SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.

Enable( BACKGROUND );

Delay( 1 );
end;

///////////////////////////////////////////////////////////////////////////////
// //
// Function: CheckRequirements //
// //
// Purpose: This function checks all minimum requirements for the //
// application being installed. If any fail, then the user //
// is informed and the setup is terminated. //
// //
///////////////////////////////////////////////////////////////////////////////
function CheckRequirements()
NUMBER nvDx, nvDy, nvResult;
STRING svResult;

begin

bWinNT = FALSE;
bIsShellExplorer = FALSE;

// Check screen resolution.
GetExtents( nvDx, nvDy );

if (nvDy < 480) then
MessageBox( @ERROR_VGARESOLUTION, WARNING );
abort;
endif;

// set 'setup' operation mode
bIs32BitSetup = TRUE;
GetSystemInfo( ISTYPE, nvResult, svResult );
if (nvResult = 16) then
bIs32BitSetup = FALSE; // running 16-bit setup
return 0; // no additional information required
endif;

// --- 32-bit testing after this point ---

// Determine the target system's operating system.
GetSystemInfo( OS, nvResult, svResult );

if (nvResult = IS_WINDOWSNT) then
// Running Windows NT.
bWinNT = TRUE;

// Check to see if the shell being used is EXPLORER shell.
if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
if (nvResult >= 4) then
bIsShellExplorer = TRUE;
endif;
endif;

elseif (nvResult = IS_WINDOWS95 ) then
bIsShellExplorer = TRUE;

endif;

end;


///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdWelcome //
// //
// Purpose: This function handles the standard welcome dialog. //
// //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdWelcome()
NUMBER nResult;
STRING szTitle, szMsg;
begin

szTitle = "";
szMsg = "";
nResult = SdWelcome( szTitle, szMsg );

return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
// //
// Function: DialogShowSdFinishReboot //
// //
// Purpose: This function will show the last dialog of the product. //
// It will allow the user to reboot and/or show some readme text. //
// //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdFinishReboot()
NUMBER nResult, nDefOptions;
STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
NUMBER bOpt1, bOpt2;
begin

if (!BATCH_INSTALL) then
bOpt1 = FALSE;
bOpt2 = FALSE;
szMsg1 = "";
szMsg2 = "";
szOption1 = "";
szOption2 = "";
nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
return 0;
endif;

nDefOptions = SYS_BOOTMACHINE;
szTitle = "";
szMsg1 = "";
szMsg2 = "";
nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );

return nResult;
end;

// --- include script file section ---

#include "sddialog.rul"



i want to adding Adding Environment Variables
i found the PathSetup.rul

the code is

// Static values for RefreshEnvironment()
#define HWND_BROADCAST 0xFFFF
#define WM_SETTINGCHANGE 0x001A
#define SMTO_ABORTIFHUNG 0x0002
prototype BOOL USER.SendMessageTimeout(HWND, SHORT, SHORT, POINTER, SHORT, SHORT, POINTER);
prototype LONG KERNEL.GetLastError();

prototype SetEnvPath(STRING, BOOL);
prototype SetRegValue(STRING, STRING, STRING);
prototype STRING GetRegValue(STRING, STRING, STRING);
prototype RemoveFromPath(STRING);
prototype RefreshEnvironment();


function SetEnvPath(szWorkPath, bAddMe)
NUMBER nResult;
STRING szKey;
STRING szOldPath;
STRING szNewPath;
NUMBER nvSize, nvType;
STRING sTemp;

begin

Disable(LOGGING) ;

szOldPath = GetRegValue("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","Path=classpath=C:\j7;C:\JBuilderX\lib\dx.jar;C:\JBuilderX\lib\beandt.jar;C:\JBuilderX\lib\dbswing.jar;C:\JBuilderX\lib\jbcl.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\JBuilderX\lib\classes12.zip;C:\jorbis7\lib\datepicker\javadatepicker.jar;C:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt.jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\JBuilderX\jdk1.4\lib\tools.jar",""); if bAddMe then
// Does the path we want to add already exist in the path?
if (szOldPath % szWorkPath) then
Enable(LOGGING ) ;
return 0;
endif;

szNewPath = szOldPath + ";" + szWorkPath;
else
szNewPath = szWorkPath;
endif;

nResult = SetRegValue("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","Path=calsspath=C:\j7;C:\JBuilderX\lib\dx.jar;C:\JBuilderX\lib\beandt.jar;C:\JBuilderX\lib\dbswing.jar;C:\JBuilderX\lib\jbcl.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\JBuilderX\lib\classes12.zip;C:\jorbis7\lib\datepicker\javadatepicker.jar;C:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt.jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\JBuilderX\jdk1.4\lib\tools.jar",szNewPath); if (nResult < 0) then
MessageBox("Unable to set Path environment variable.", WARNING);
else
// Flush the NT registry to all applications.
RefreshEnvironment();
endif;

Enable(LOGGING ) ;
end;

// Get a registry value from HKEY_LOCAL_MACHINE
function STRING GetRegValue(szPath, szKey, szDefault)
STRING svValue;
NUMBER nvType;
NUMBER nvSize;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx(szPath,szKey,nvType, svValue, nvSize);

if svValue = "" then
return szDefault;
else
return svValue;
endif;
end;

// Set a registry value in HKEY_LOCAL_MACHINE
function SetRegValue(szPath, szKey, szValue)
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBCreateKeyEx(szPath,"");
return RegDBSetKeyValueEx(szPath,szKey,REGDB_STRING_EXPAND,szValue,-1);
end;

function RemoveFromPath(szRemoveMe)
STRING szKey;
NUMBER nvType;
STRING svValue;
NUMBER nvSize;
STRING szNewPath, szPath;
STRING szBeginPath, szEndPath;
NUMBER nLength, nPos;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

// Get the current Path
szPath = GetRegValue("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","Path=classpath=C:\j7;C:\JBuilderX\lib\dx.jar;C:\JBuilderX\lib\beandt.jar;C:\JBuilderX\lib\dbswing.jar;C:\JBuilderX\lib\jbcl.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\JBuilderX\lib\classes12.zip;C:\jorbis7\lib\datepicker\javadatepicker.jar;C:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt.jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\JBuilderX\jdk1.4\lib\tools.jar","");

// Look for the path we want to remove in the current path
nPos = StrFind(szPath,szRemoveMe);

// If we found it
if nPos >= 0 then
nLength = StrLength(szRemoveMe);

// Is the location of the path we want to remove at the beginning of the
// system path? If not, get everything up to that position.
if nPos > 0 then
StrSub(szBeginPath,szPath,0,nPos);
endif;

// Make sure there is something to copy after the path we want to remove.
// If there is, get everything after the path we want to remove.
if nPos + nLength < StrLength(szPath) then
StrSub(szEndPath,szPath,nPos + nLength + 1, StrLength(szPath) - nPos - nLength);
endif;

// If EndPath is blank then there is a trailing semicolon in BeginPath
// that needs to be removed.
if szEndPath = "" then
StrSub(szBeginPath,szBeginPath,0,StrLength(szBeginPath) -1);
endif;

// Add the beginpath and endpath together and we have the new path.
szNewPath = szBeginPath + szEndPath;

// Set the new path.
SetEnvPath(szNewPath,FALSE);
endif;
end;



function RefreshEnvironment()
STRING sParam;
POINTER pParam, pResult;
LONG lResult;

begin
sParam = "Environment";
pParam = &sParam;
pResult = &lResult;

if (!SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, pParam, SMTO_ABORTIFHUNG, 100, pResult))
then
SprintfBox(WARNING, "", "SendMessageTimeout failed in RefreshEnvironment, Error %d", GetLastError());
endif;
end;



this code is ok?




how can union these 2 codes?
i dont khow stript for installshield

thanks very much


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 06 October 2005 - 04:43

To make use of the PathSetup.rul file, use Windows Explorer to place it directly beside the project's setup.rul and then expand the includes at the top of setup.rul by adding the following code:

CODE
#include PathSetup.rul

At that point you can call all of its functions (e.g. SetEnvPath, SetRegValue, etc.).

However, that path value is extremely long. So long in fact that line 27 of PathSetup.rul exceeds the 255 character limit for string literal resulting in various compile errors.

Edited by Taco Bell, 06 October 2005 - 04:43.

user posted image

earn

earn
  • Members
  • 5 posts

Posted 06 October 2005 - 07:37

QUOTE (Taco Bell @ 2005-10-06 04:43)
To make use of the PathSetup.rul file, use Windows Explorer to place it directly beside the project's setup.rul and then expand the includes at the top of setup.rul by adding the following code:

CODE
#include PathSetup.rul

At that point you can call all of its functions (e.g. SetEnvPath, SetRegValue, etc.).

However, that path value is extremely long. So long in fact that line 27 of PathSetup.rul exceeds the 255 character limit for string literal resulting in various compile errors.

thanks for reply

you sead line 27 of PathSetup.rul exceeds the 255 character limit for string
how can i have this lond string?


C:\j7;C:\JBuilderX\lib\dx.jar;C:\JBuilderX\lib\beandt.jar;C:\JBuilderX\lib\dbswing.jar;C:\JBuilderX\lib\jbcl.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\JBuilderX\lib\classes12.zip;C:\jorbis7\lib\datepicker\javadatepicker.jar;C:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt.jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\JBuilderX\jdk1.4\lib\tools.jar


earn

earn
  • Members
  • 5 posts

Posted 06 October 2005 - 07:40

nResult = SetRegValue("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","Path=classpath=C:\j7;C:\JBuilderX\lib\dx.jar;",szNewPath);

this Path=classpath=
is right code?

or want only classpath= ??????????

thanks


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 06 October 2005 - 14:46

It's a hard-coded limit, so I don't know how you'd get around short of doing multiple passes until you've written out all you need.

However, you really shouldn't need that long a string in the first place as the Path environmental variable only points to directories (i.e. C:\JBuilderX\lib), NOT individual files (e.g. C:\JBuilderX\lib\dx.jar).
user posted image