Overwriting HKEY_CURRENT_USER registry settings doesn't work?

G

Günter Wirth

Hi,

I tried to overwrite HKEY_CURRENT_USER registry settings in an own
component. It doesn't work. It seems that after logging in the first time
the system overwrite my settings again.

- I tried to set the values in HKEY_CURRENT_USER and HKEY_USERS\.DEFAULT,
without success.
- I tried to increase the Build Order to 3000, without success.
- I tried to set a Build Order Depedeny (before Administrator Account and
User Account), without success.

How can I solve that problem?

Regards,
Günter
 
Z

Zirong Wang

you may want to try modify the key
HKU\.DEFAULT instead of HKCU.
HKCU will exist only for the user that have been created.
 
Z

Zirong Wang

that was I feared. so let's use the big gun:

1. create a FBA generic command in one of your component of
in the extra resources

argument string: /c %24%\foo.bat
filepath: %11%\cmd.exe
phase: 8498


2. create a file in your system drive called foo.bat with
the following content:

rundll32 setupapi,InstallHinfSection DefaultInstall 128
%systemdrive%\config.inf

note that the above is in one line.

3. create a file config.inf with the following for example:

;======================================================================
; this file will perform various and misc system configuration
;======================================================================
[Version]
Signature = "$Windows NT$"

[DefaultInstall]
AddReg = AddReg
DelReg = DelReg
UpdateInis = UpdateInis

[AddReg]
; set the default background color
HKU,".DEFAULT\Control Panel\Colors","Background",0x00000000,"0 101 103"

HKU,".DEFAULT\Control Panel\Desktop","AutoEndTasks",0x00000000,1
HKU,".DEFAULT\Control Panel\Desktop","MenuShowDelay",0x00000000,200
HKU,".DEFAULT\Control Panel\Desktop","PowerOffActive",0x00000000,1
HKU,".DEFAULT\Control Panel\Desktop","PowerOffTimeOut",0x00000000,500

; date and time format
HKU,".DEFAULT\Control Panel\International","sLongDate",0x00000000,"dddd,
yyyy-MM-dd"
HKU,".DEFAULT\Control
Panel\International","sShortDate",0x00000000,"yyyy-MM-dd"
HKU,".DEFAULT\Control
Panel\International","sTimeFormat",0x00000000,"HH:mm:ss"


please pay attention with false line breaks

Zirong
 
G

Günter Wirth

Hi,

Thank you for that hint.

Two more questions:
- What means phase 8498?
- When does the build up process start the INF file?

Regards,
Günter
 
Z

Zirong Wang

hi Gunter,

Günter Wirth said:
- What means phase 8498?
when you create a resource like FBA generic command, you must
specify when it will be get executed.
the phase 8498 is the moment at almost the end of FBA, to avoid
HKU\.DEFAULT get erased like you did in TD, put it in phase
8498 garantees that your .inf will be taken into account.
- When does the build up process start the INF file?
with the foo.bat, executed at the near end of FBA like we state it.
you must create your own .inf file (in my example, it is config.inf),
add this file as an extra resource.
 
G

Günter Wirth

Hi,

Where can I find a general description of the phases?

Regards,
Günter
 
Z

Zirong Wang

in the development machine where you installed your embedded
dev tools.
start->program->embedded studio->documentation-.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top