Program correction of variables of the environment in Alaska

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Program correction of variables of the environment in Alaska

#1 Post 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.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Program correction of variables of the environment in Al

#2 Post 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
Regards,
Jack Duijf

User avatar
Tom
Posts: 1185
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Program correction of variables of the environment in Al

#3 Post by Tom »

It's quite simple:

Code: Select all

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

Code: Select all

SetEnv("path","c:\mydocs")
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Program correction of variables of the environment in Al

#4 Post by rdonnay »

Look at the functions DC_RegQuery() and DC_RegWrite().
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Program correction of variables of the environment in Al

#5 Post 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!

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Program correction of variables of the environment in Al

#6 Post 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

Post Reply