Jump to content











Photo
- - - - -

Time zone and locality - Win7PE


  • Please log in to reply
60 replies to this topic

#26 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 25 May 2011 - 04:03 PM

Yes, a shared idea ;)
The default is to retrieve time zone information from install.wim source CD with the script above.
But, a mini tweaks with information from Hostos is a good thing, if needed, with Time Zone for now, it will be completed in the future with other localization information from Hostos and contribution.
I'll write it soon.

:)

#27 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 25 May 2011 - 05:33 PM

The default is to retrieve time zone information from install.wim source CD with the script

I do not understand the intention!

In the 1-files.Script
FileCopy,%b32%\config\system,%t32%\config

(%b32%=mounted boot.wim)

is executed. And this hive contains the valid timezone entries.

Why overwrite with the same information from install.wim?


The only reasonable option here would be like sbaeder suggested.
Either do nothing, because you already have the information from the source CD.
Or, when you want to overwrite the source CD's information with your local conditions, use the Reg2WBS method by sbaeder.

Or use something "third party app independent" like this (Just brainstorming, no guarantee):
RegHiveLoad,WB-Default,%Target_sys%\config\default

RegRead,HKCU,"Software\Microsoft\Windows NT\CurrentVersion\Time Zones",TimeZoneKeyName,%TmpResult%

RegWrite,HKLM,0x1,"WB-Default\Software\Microsoft\Windows NT\CurrentVersion\Time Zones",TimeZoneKeyName,%TmpResult%

RegHiveUnload,WB-Default

// PE1 or PE2/PE3 ?

If,EXISTFILE,%target_sys%\setupreg.hiv,RegHiveLoad,WB-Setup,%target_sys%\setupreg.hiv

Else,RegHiveLoad,WB-Setup,%target_sys%\config\system

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"Bias",%_Val%

RegWrite,HKLM,0x4,WB-Setup\ControlSet001\Control\TimeZoneInformation,"Bias",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"StandardName",%_Val%

RegWrite,HKLM,0x1,WB-Setup\ControlSet001\Control\TimeZoneInformation,"StandardName",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"StandardBias",%_Val%

RegWrite,HKLM,0x4,WB-Setup\ControlSet001\Control\TimeZoneInformation,"StandardBias",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"StandardStart",%_Val%

RegWrite,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,"StandardStart",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"DaylightName",%_Val%

RegWrite,HKLM,0x1,WB-Setup\ControlSet001\Control\TimeZoneInformation,"DaylightName",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"DaylightBias",%_Val%

RegWrite,HKLM,0x4,WB-Setup\ControlSet001\Control\TimeZoneInformation,"DaylightBias",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"DaylightStart",%_Val%

RegWrite,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,"DaylightStart",%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"ActiveTimeBias",%_Val%

RegWrite,HKLM,0x4,WB-Setup\ControlSet001\Control\TimeZoneInformation,"ActiveTimeBias",%_Val%

RegHiveUnLoad,WB-Setup

Peter

#28 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 25 May 2011 - 06:05 PM

I do not understand the intention!

Bootwim designed for small cmd shell, and for that very reason some settings are missing, time zone information is one of them.
I checked it previously, the time zone info in boot.wim are generic, that in install.wim correspond for me with that of my HostOS.

that's why ozziegirl has wrong time. The local process corrects things for french German, .. (systeme locale in main configuration) but not for all localization.

I am in process of writing the script for Hostos retrieve info (just Timezone for now). with same approach

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,"DaylightStart",%_Val% 

RegWrite,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,"DaylightStart",%_Val%
But I will recall you that there is a bug on WB 80 (corrected in 81) on regread-regwrite binary data, this don't work, so the workaround.

:dubbio:

#29 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 25 May 2011 - 06:28 PM

Bootwim designed for small cmd shell, and for that very reason some settings are missing, time zone information is one of them.
I checked it previously, the time zone info in boot.wim are generic, that in install.wim correspond for me with that of my HostOS.

You are right! :dubbio:

Using the entries from install.wim, could be done (like now) automatically and quietly.
But the option "From Host" should be a visible option anywhere. :pressure:

Peter :cheers:

#30 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 25 May 2011 - 08:41 PM

But I will recall you that there is a bug on WB 80 (corrected in 81) on regread-regwrite binary data

surprisingly this works for me with WB 80

FileCreateBlank,%ScriptDir%\t.txtTXTAddLine,%ScriptDir%\t.txt,"[Process]",AppendRegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,DaylightStart,%tzi%TXTAddLine,%ScriptDir%\t.txt,"RegWrite,HKLM,0x3,WB-System\ControlSet001\Control\TimeZoneInformation,DaylightStart,%tzi%",AppendRegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,StandardStart,%tzi%TXTAddLine,%ScriptDir%\t.txt,"RegWrite,HKLM,0x3,WB-System\ControlSet001\Control\TimeZoneInformation,StandardStart,%tzi%",AppendRegHiveLoad,"WB-System","%RegSystem%"Run,%ScriptDir%\t.txt,ProcessRegHiveUnLoad,"WB-System"FileDelete,%ScriptDir%\t.txt


#31 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 25 May 2011 - 08:49 PM

Yes Dera, your code works with WB 80, you use the same workaround that Lancelot suggested, write to a file and run it (see prior post 7) Posted Image .

#32 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 25 May 2011 - 09:16 PM

Here are all the modified scripts for timezone and Windows Time service.
With time zone info in automatic and quiet operation from install.wim and a new script "Hostos Info" with the option 'retrieve time zone from Hostos' in components, if needed.

Attached File  TimeZone.7z   4.22MB   510 downloads

They will be available tomorrow on the server win7pe.winbuilder.net/SE

:dubbio:

#33 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 26 May 2011 - 11:06 AM

Yes Dera, your code works with WB 80, you use the same workaround that Lancelot suggested, write to a file and run it (see prior post 7) Posted Image .

OK, sorry,
seems probably i have overlooked (missed) that post,
anyway this trick what i used is not my idea - originated with a friend of my called Lancelot.

#34 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 May 2011 - 04:25 PM

OK, sorry,
seems probably i have overlooked (missed) that post,
anyway this trick what i used is not my idea - originated with a friend of my called Lancelot.

Can you tell your friend a secret: When he sometimes would have spent some time in observing the development, rather than :cheers: the development, maybe (depending on his creativity and intelligence) he perhaps should have found that this code:
RegHiveLoad,WB-Setup,%target_sys%\config\system

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,StandardStart,%_Val%

RegWriteBinEx,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,StandardStart,%_Val%

RegRead,HKLM,SYSTEM\CurrentControlSet\Control\TimeZoneInformation,DaylightStart,%_Val%

RegWriteBinEx,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,DaylightStart,%_Val%

RegHiveUnLoad,WB-Setup

works for 080 as well as for 081.

Peter :thumbup:

#35 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 27 May 2011 - 05:19 AM

RegWriteBinEx
FINE!
(somehow this WB command escaped my attention, i mean i never known that there is such command,
seems i should read the winbuilder.chm more often)

#36 delta925

delta925

    Newbie

  • Advanced user
  • 10 posts
  •  
    United Kingdom

Posted 12 May 2012 - 04:10 PM

I am in the UK so have set the locale to English UK.

What I am finding is every time I boot a computer from my Win7PE CD the clock gets advanced by one hour.

Any advice to prevent this happening will be appreciated.

#37 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 12 May 2012 - 06:36 PM

Can you try to start the w32time service (Internet time synchronization),
It is configured for automatic startup but it remains stopped.

To keep your PE without rebuilding
- Use the script mount (Utils folder) and Mount PE in %TargetDir%
- in explorer Edit autorun.cmd (TargetWin7PE_SEWindowsSystem32 Folder)
- add: net start w32time before exit
- in mount script use the Unmount button
- in Create ISO script (Finals folder) use the create new ISO file button

tell me if it's OK

Edit: Otherwise,in locale.script the UK setting for TimeZoneInformation are OK, but configured in winter time.
If we change it with the winter time, in November, December..., we will have the opposite (change managed by the w32time service).
for (UTC) London : HKLMSystemControlSet001ControlTimeZoneInformation,ActiveTimeBias,0 <==> 0xffffffc4 (-60)

:cheers:

#38 u2o

u2o

    Frequent Member

  • .script developer
  • 257 posts
  • Location:Argentina
  •  
    Argentina

Posted 13 May 2012 - 03:39 AM

I am in the UK so have set the locale to English UK.

What I am finding is every time I boot a computer from my Win7PE CD the clock gets advanced by one hour.

Any advice to prevent this happening will be appreciated.


Your problem is the UTC/GMT time... Try this script http://reboot.pro/fi...ettings-win7pe/

Attached Thumbnails

  • TimeZoneAndRegional_Win7PE_v3.jpg

Edited by u2o, 13 May 2012 - 03:40 AM.
UTC/GMT


#39 delta925

delta925

    Newbie

  • Advanced user
  • 10 posts
  •  
    United Kingdom

Posted 14 May 2012 - 08:55 PM

Thank you both for responding.

As soon as I get time I will try both of these and post my findings.

I did wonder if during GMT the time would not jump ahead.

For my needs a simple pop-up during boot to select GMT or BST would be fine.

Should it be relevant as I only want to run a specific application I have started from the Win7PE_SE_20120416_Small download.

#40 u2o

u2o

    Frequent Member

  • .script developer
  • 257 posts
  • Location:Argentina
  •  
    Argentina

Posted 16 May 2012 - 03:49 AM

I did wonder if during GMT the time would not jump ahead.


Try and see ... I had the same problem and that was the reason for creating this script, so everyone can more easily change those settings.

For my needs a simple pop-up during boot to select GMT or BST would be fine.

Should it be relevant as I only want to run a specific application I have started from the Win7PE_SE_20120416_Small download.


The idea is to put your setting for UTC/GMT. Once you put it, you no longer will need to change it. Unless you move from your country to another... and then again need to change your time zone.
Also you can modify whenever your time zone from the date and time settings.

#41 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 16 May 2012 - 09:57 AM

Your script is fine :good:.
In Win7pese, for the locations listed in main configuration the result is the same and for UK we have the same timezone informations (for auto, with use information from install.wim hive).
Tthere is also the script "HostOS Import Manager" in components folder to import TimeZone from the HostOS.
Your script provides more by extending the possibilities to customize by choosing the time zones :)

However, I do not think it solves the issue of summer time or winter time.
ActiveTimeBias is entered in the registry at build time with the config for daylight saving time or the winter time (0 or -60 here).
At startup, the system uses this value to set the time without changing ActiveTimeBias, registered when building.

ActiveTimeBias:
This value is the current time difference from UTC in minutes, regardless of whether daylight saving is in effect or not. It is this value that helps establish the current Time Zone settings. Using the formula above, take this value and add it to local time to get the UTC value.

some info here http://blog.digital-...of-suspect.html

Starting the w32time service allows to synchronize the time with internet and thereby change ActiveTimeBias and others timezones keys.


A little like your "Timezone and Regional Settings" script, I wrote an au3 program to generated automatically a part of TimeZone.script by using :
Save current config
Read all subkey in "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
Used the Ms command line tzutil tool
convert the registry in PE with RegCPE (to put in same folder that time.exe or time.au3)
Restore config
Attached File  time.7z   378.64KB   466 downloads

#42 u2o

u2o

    Frequent Member

  • .script developer
  • 257 posts
  • Location:Argentina
  •  
    Argentina

Posted 16 May 2012 - 10:57 AM

Your script is fine :good:.
In Win7pese, for the locations listed in main configuration the result is the same and for UK we have the same timezone informations (for auto, with use information from install.wim hive).
Tthere is also the script "HostOS Import Manager" in components folder to import TimeZone from the HostOS.
Your script provides more by extending the possibilities to customize by choosing the time zones :)

However, I do not think it solves the issue of summer time or winter time.
ActiveTimeBias is entered in the registry at build time with the config for daylight saving time or the winter time (0 or -60 here).
At startup, the system uses this value to set the time without changing ActiveTimeBias, registered when building.

ActiveTimeBias:
This value is the current time difference from UTC in minutes, regardless of whether daylight saving is in effect or not. It is this value that helps establish the current Time Zone settings. Using the formula above, take this value and add it to local time to get the UTC value.

some info here http://blog.digital-...of-suspect.html

Starting the w32time service allows to synchronize the time with internet and thereby change ActiveTimeBias and others timezones keys.

Good point sir! I need testers and the script needs more work... But is easily updatable... As I can I'll get to work on it.

A little like your "Timezone and Regional Settings" script, I wrote an au3 program to generated automatically a part of TimeZone.script by using :
Save current config
Read all subkey in "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
Used the Ms command line tzutil tool
convert the registry in PE with RegCPE (to put in same folder that time.exe or time.au3)
Restore config
Attached File  time.7z   378.64KB   466 downloads

That's a good idea, but the problem is that you need Windows7 as host to work ... Or not?

I before had thought of an application with a database, exported to a script everything you need, so that the resulting script did haven't more than 40 lines (at most), instead of 2000 as it has now. But I have a great conflict with the programming languages (paid) ​​to the point that I am now studying C++ (with Dev-C++) then I could distribute applications...

#43 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 May 2012 - 01:14 PM

Imo, a PE should never meddle with the BIOS clock. But just accept the value as given for local time.

The main problem with PE correcting the BIOS clock at start/end of daylightsavingtime is, that the regular OS will do so too on next start. So the watch will be corrected twice.

Maybe a checkbox to enable/disable daylightsavingtime correction, would be interesting for the folks, who use PE as a regular OS, which i'm sure do not exist! ;)

:cheers:

#44 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 16 May 2012 - 01:48 PM

That's a good idea, but the problem is that you need Windows7 as host to work ... Or not?

Yes, but it is only to help to write the script

Maybe a checkbox to enable/disable daylightsavingtime correction, would be interesting for the folks, who use PE as a regular OS, which i'm sure do not exist! ;)

Also yes, why not, but in this case the Pe can be used for only 6 months. I think it is better to net start W32Time in order to have the Internet synchronization.
use PE as a regular OS, of course not, it does not exist ;)

:cheers:

#45 delta925

delta925

    Newbie

  • Advanced user
  • 10 posts
  •  
    United Kingdom

Posted 16 May 2012 - 08:35 PM

As MedEvil says ideally the PE should not adjust the BIOS clock, which would resolve my current issue.

The internet time solution is not appropriate to my application since the computers are never connected to the internet nor indeed a local network. I would have though this was more likely than not in most situations where PE was being used.

Hence my suggestion of a prompt during boot to select if the current timezone is GMT or GMT+1 which, so long as the correct option was chosen, would select the appropriate section of a script to ensure the BIOS clock was not changed.

#46 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 16 May 2012 - 10:19 PM

There is no intention to change the BIOS clock nowhere.
I do not know where MedEvil saw it in previous posts :dubbio:

I am not really favorable of a selection during boot time, it must remain the fastest possible without user intervention. perhaps a shortcut.

The idea of putting a checkbox to change daylight saving time, why not, but at the next time change ...
I still think that starting the w32time service is the best answer, but, in fact, difficult in your case without internet access.

#47 delta925

delta925

    Newbie

  • Advanced user
  • 10 posts
  •  
    United Kingdom

Posted 17 May 2012 - 07:24 PM

First let me say I'm not a programmer / software engineer so have very limited knowledge / understanding of exactly how the scripts work, the options available, limitations etc

Second producing a ' one size fits all solution ' will always be a compromise.

Regarding the BIOS clock.
At least with my build based on the small version it is getting changed because if I boot a PC 3 times with Win7PE the clock will be three hours ahead.
For my requirements it does not matter while running PE if the time is an hour adrift either way. The nuisance is that when I go to run the installed OS again the clock has been changed to the last time shown when running PE rather than remaining as if PE had never been run.

In the grand scale of things this is a niggle but I would prefer a prompt during a boot than to have to remember to reset the clock at some point before shutdown.

If it could be done easily in the Win7PE build settings the option either use internet time or to have a prompt would satisfy both those who want to run PE without intervention and those happy to have a prompt during boot.

#48 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 17 May 2012 - 11:00 PM

Mea culpa for BIOS clock which is really changed at startup :blush: .

By cons, by looking at the configs for UK and French in locale.script, I found a difference which seems important to keep the same hours as the bios.
In the french config the key ActiveTimeBias is not written and in this case, at PE startup, the CMOS clock seems to be used and ActiveTimeBias is adjusted accordingly.
If it works fine, no more problems for Daylight Saving Time and Standard Time :)

Can you try with this modified script (to put in build folder)
Attached File  locale.7z   11.58KB   448 downloads

Or if you do not want to rebuild your PE :
- use the Regedit script in utils folder, button Edit Hives (System hive)
- delete the ActiveTimeBias key in HKLMTmp_SystemControlSet001ControlTimeZoneInformation and close regedit.
- rebuild your iso with "Create ISO" script (finals folder), button "Create new ISO file"

:cheers:

#49 delta925

delta925

    Newbie

  • Advanced user
  • 10 posts
  •  
    United Kingdom

Posted 19 May 2012 - 08:22 PM

Thank you for resolving this.

I replaced the script and rebuilt the project.

Now the clock does not change when Win7PE runs and is correct when the installed OS is run afterwards.

#50 Guest_Boot_Monkey_*

Guest_Boot_Monkey_*
  • Guests

Posted 15 June 2012 - 03:01 AM

OK folks, all my builds are way out in time and date.

Locale, TimeZone are correct, but the time is out by 18Hrs.

I'm in UTC +10.

I've downloaded some scripts from this thread but now not sure if they have already been intregrated into Win7PE_SE or not.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users