Page 1 of 1

Program correction of variables of the environment in Alaska

Posted: Fri Aug 03, 2012 9:35 pm
by Eugene Lutsenko
Whether program correction of variables of the environment and the register in Alaska is possible? It is necessary for me for development of the program of installation of system which I develop. On Visual Basic it looked approximately so:

Code: Select all

Dim Message, Title, Name, Name1
Dim WshShell, objEnv
Dim WshExec, Res, file, fso

Set WshShell = CreateObject("WScript.Shell")

WshShell.Run "vfp9setup.exe",1,true

WshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\DosKeybCodes\00000409","ru","REG_SZ"

Set objEnv = WshShell.Environment("USER")
objEnv("FILES") = "255"
objEnv("CLIPPER") = "F:250"
objEnv("SET CLIPPER") = "F:250"

Set objEnv = WshShell.Environment("SYSTEM")
objEnv("FILES") = "255"
objEnv("CLIPPER") = "F:250"
objEnv("SET CLIPPER") = "F:250"

objEnv("PATH") = "F:\CL5_WIN\NC;F:\CL5_WIN\ME;F:\CL5_WIN\BIN;F:\CL5_WIN\OBJ;F:\CL5_WIN\NG"
objEnv("SET LIB") = "F:\CL5_WIN\LIB"
objEnv("LIB") = "F:\CL5_WIN\LIB"
objEnv("SET OBJ") = "F:\CL5_WIN\OBJ"
objEnv("OBJ") = "F:\CL5_WIN\OBJ"
objEnv("SET INCLUDE") = "F:\CL5_WIN\INCLUDE"
objEnv("INCLUDE") = "F:\CL5_WIN\INCLUDE"
objEnv("SET TEMP") = "F:\TEMP"
objEnv("SET TMP") = "F:\TEMP"

Set fso=CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("H:\WINDOWS\system32\AUTOEXEC.NT",8)
file.Write (vbCRLF)
file.Write ("lh %SystemRoot%\system32\kb16.com ru")

Message = "Редактирование реестра, переменных сред и файла autoexec.nt завершено"

Title = "Установка среды разработки CL5_WIN " & " - by Eugene Lutsenko"

MsgBox Message, vbInformation + vbOKOnly, Title
The truth now while to me it is not necessary to correct the register.

Re: Program correction of variables of the environment in Al

Posted: Sat Aug 04, 2012 6:19 am
by jdsoft
Hello,

If i read correctly, you are looking forcode to update/read the windows registry.

Try http://www.software-braun.de/articles/2 ... stry-class this.

Regards,
Jack Duijf

Re: Program correction of variables of the environment in Al

Posted: Sat Aug 04, 2012 6:44 am
by Tom
It's quite simple:

Code: Select all

SetEnv( <cSetVar>, <cValue> )
For example:

Code: Select all

SetEnv("path","c:\mydocs")

Re: Program correction of variables of the environment in Al

Posted: Sat Aug 04, 2012 8:10 am
by rdonnay
Look at the functions DC_RegQuery() and DC_RegWrite().

Re: Program correction of variables of the environment in Al

Posted: Sat Aug 04, 2012 9:20 am
by Eugene Lutsenko
Simplicity is relative and depends on competence. That for knowing simply, for ignorant a problem. Now, thanking, to you and for me it is simple. Thanks!

Re: Program correction of variables of the environment in Al

Posted: Fri Aug 24, 2012 5:56 am
by Eugene Lutsenko
I wrote it on VB as the program of installation of the program should work at Alaska and eXpress++ in general without libraries of Alaska and eXpress++:

Code: Select all

Dim Message, Title, Name, Name1
Dim WshShell, objEnv
Dim WshExec, Res, file, fso

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "DLL-ALASKA.exe",1,true
WshShell.Run "Aidos-X.exe",1,true

Set objEnv = WshShell.Environment("USER")
M_Path = objEnv("PATH")
objEnv("PATH") = M_Path+";c:\DLL-ALASKA\"

Set objEnv = WshShell.Environment("SYSTEM")
M_Path = objEnv("PATH")
objEnv("PATH") = M_Path+";c:\DLL-ALASKA\"

Message = "Установка среды исполнения, редактирование переменных среды и инсталляция системы Эйдос-Х++ успешно завершены! После инсталляции необходимо перезагрузить компьютер!"

Title = "Инсталляция системы Эйдос-Х++, (с) Евгений Луценко (06.08.12)"

MsgBox Message, vbInformation + vbOKOnly, Title