Jump to content

Recommended Posts

Posted

Hello Guys, just a quick one is it @ all possible to preset gadget setting for the MS weather app to show the correct location eg Sydney NSW.

In my xml I nominate my local setting for time zone etc & region, timezone is perfect in UA. However the gadget automatically picks Canberra as default location? Canberra is close to Sydney but is not what I require.

I can manually change upon install. Is there anyway to export the setting to use in UA?

Thanks,


Posted (edited)

Yes! I do like this (for Calendar, Weather and Clock Gadgets):

1) On your computer you can select the options you want

2) Go to "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" (show hiden files and folders)

3) Copy/paste the Settings.ini file inside your distribution folder: %Win7_Folder%\sources\$OEM$\$$\SETUP\SCRIPTS\Settings.ini

4) Create a batch file to the silent installation and set this one inside the same folder SCRIPTS:

I use WPI 8.1.0 to launch this batch file at last:

Clean.cmd


REM Gadgets Settings customized
attrib -A -I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
COPY /Y "%~dp0Settings.ini" "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\"
attrib +A +I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
REM Restart 'sidebar.exe'
SET KEY=HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files\Windows Sidebar\sidebar.exe" /f
shutdown.exe /r /t 30

I chose also the same Gadgets inside my Autounattend.xml.

*Edit: post updated with the correct attributes for the Settings.ini file.

Edited by myselfidem
Posted (edited)

Thanks ;)

Maybe it's possible.

I haven't tested, but I think in this case it's better do not set Gadgets inside Autounattend.xml file, because the file Settings.ini will be modded as default settings (I think)!

But you can choose to set the Gadgets after the installation is complete and your customized settings will be displayed.

Cheers.

Edited by myselfidem
Posted

Thanks ;)

Maybe it's possible.

I haven't tested, but I think in this case it's better do not set Gadgets inside Autounattend.xml file, because the file Settings.ini will be modded as default settings (I think)!

But you can choose to set the Gadgets after the installation is complete and your customized settings will be displayed.

Cheers.

Just tested, forget my method your right setup will overwrite if Gadgets specified in your xml :unsure: Next step will test your method.

Posted (edited)

Here is the result with the batch file with my customized settings for the Gadgets.

Settings.ini customized and added Gadgets inside Autounattend.xml file.

Weather settings are set for Geneva (Switzerland).

Image Gadgets customized at first logon

Image Gadgets with the Internet connection

*Edit: a restart is needed to see the Gadgets settings customized !

1) At first, the settings inside the Autounattend.xml file installs the Gadgets wanted.

2) And at last the Settings.ini is overwrited (writing a new time) with the customized settings with the batch file.

3) After the reboot we can see the Gadgets customized with our personnal settings.

*Edit 2: Maybe that can solve some trouble

You can also add this reg file inside the SCRIPTS folder

Tweaks.reg


Windows Registry Editor Version 5.00

; Restore Gadgets on the Desktop after disabling UAC

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sidebar\Settings]
"AllowElevatedProcess"=dword:00000001

; Show Gadgets

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"Sidebar"="\"C:\\Program Files\\Windows Sidebar\\sidebar.exe /autoRun""

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Sidebar]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Sidebar\Settings]
"ShowGadgets"=dword:00000001

Clean.cmd


attrib -A -I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
COPY /Y "%~dp0Settings.ini" "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\"
attrib +A +I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
REM Restart 'sidebar.exe'
SET KEY=HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files\Windows Sidebar\sidebar.exe" /f
REM Registry Tweaks
REGEDIT /S "%systemroot%\Setup\scripts\Tweaks.reg"
shutdown.exe /r /t 30

*Edit: post updated with the correct attributes for the Settings.ini file.

Edited by myselfidem
Posted

The Desktop must be load first and after the batch file is launched (I use WPI) to work properly!

After the installation is done, check if the Settings.ini file is the good one!

  • 2 weeks later...
Posted

Bugging me this! Cannot seem to have my saved ini overwrite the finished one? I'm enabling the gadgets to my liking in the xml, they all appear as they should.

Picked the eyes out of your suggestions & noticed your using runonce in the cleanup.cmd. Maybe it's a timing issue in that the desktop is slow to load whilst executing runonce possibly??

Posted (edited)

When you copy/paste the file Settings.ini, right-click on Properties and check if the "Read only" is desabled, and if not uncheck! Also for Unlok.

You can also try to create an SFX file (post #229):

http://www.msfn.org/...s/page__st__220

------------------------------------------------------------------------------------------

*Edit: Example with adding the reg file "Tweaks" inside the config.txt:

config.txt


;!@Install@!UTH-8!
GUIMode="2"
RunProgram="regedit /s Tweaks.reg"
SetEnvironment="KEY=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"
RunProgram="hidcon:attrib -A -I \"%userprofile%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Settings.ini\" /S /D"
RunProgram="hidcon:cmd /c COPY /Y Settings.ini \"%userprofile%\\AppData\\Local\\Microsoft\\Windows Sidebar\\\""
RunProgram="hidcon:attrib +A +I \"%userprofile%\\AppData\\Local\\Microsoft\\Windows Sidebar\\Settings.ini\" /S /D"
RunProgram="hidcon:cmd /c REG ADD %KEY%\\001 /V 1 /D \"%systemdrive%\\Program Files\\Windows Sidebar\\sidebar.exe\" /f"
;¨@InstallEnd@!

Tweaks.reg


Windows Registry Editor Version 5.00

; Restore Gadgets on the Desktop after disabling UAC
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sidebar\Settings]
"AllowElevatedProcess"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"Sidebar"="\"C:\\Program Files\\Windows Sidebar\\sidebar.exe /autoRun""

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Sidebar]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Sidebar\Settings]
"ShowGadgets"=dword:00000001

*Edit: If you install Windows 7 x64, you can add:

SET KEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce

REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files (x86)\Windows Sidebar\sidebar.exe" /f


REM Customizing Gadgets x64
ATTRIB -A -I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
COPY /Y "%~dp0Settings.ini" "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\"
ATTRIB +A +I "%userprofile%\AppData\Local\Microsoft\Windows Sidebar\Settings.ini" /S /D
REM Lauch 'sidebar.exe'
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files\Windows Sidebar\sidebar.exe" /f
SET KEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files (x86)\Windows Sidebar\sidebar.exe" /f
REM Customize Registry settings
REGEDIT /S "%systemroot%\Setup\scripts\Tweaks.reg"
SHUTDOWN.EXE /r /t 10
EXIT

Add same lines for using "config.txt".

Tested and works fine! (Always lauch the batch file after the desktop is loaded!

Image Gadgets on Windows 7 x64

You can also download the new Oracle Sun VirtualBox 4.0.8:

http://www.virtualbo.../wiki/Downloads

I hope that will help you!

Edited by myselfidem
Posted

When you say run batch following desktop loads this being before the sidebar is visible? Cannot make this work UA atm? If I kill the sidebar & pack the settings.ini to an archive works ok, but then have to start the sidebar again.

Posted (edited)

When you say run batch following desktop loads this being before the sidebar is visible?

Excuse my english!

After Windows® Welcome, the "Preparing Your Desktop" screen appears for up to two minutes.

It's needed to see first the sidebar (visible and installed with Autounattend.xml) and after the batch file is launched and other programs (I use WPI).

And we will see our customized Gadgets after the reboot!

I keep the same order inside Autounattend.xml and Settings.ini for the Gadgets:

Settings.ini


[Root]
SettingsVersion="00.00.00.02"

ShowGalleryPrivacyStatementOnceComplete="true"
Section0="1"
Section1="2"
Section2="3"
[Hashes]
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget="%7B196EB779-40FE-AE35-C357-36AACE0AA470%7D"
C:\Program Files\Windows Sidebar\Gadgets\Calendar.Gadget="%7BD3D8A841-CEE3-68C5-F99F-7302ABBBA0E3%7D"
C:\Program Files\Windows Sidebar\Gadgets\Weather.Gadget="%7B42DE9D91-AEE2-BAC6-FEE5-ADCC7B7904C4%7D"
...........

Autounattend.xml


</component>
<component name="Microsoft-Windows-Sidebar" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="[url="http://schemas.microsoft.com/WMIConfig/2002/State"]http://schemas.microsoft.com/WMIConfig/2002/State[/url]" xmlns:xsi="[url="http://www.w3.org/2001/XMLSchema-instance"]http://www.w3.org/2001/XMLSchema-instance[/url]">
<Gadget1>%PROGRAMFILES%\Windows Sidebar\Gadgets\Clock.Gadget</Gadget1>
<Gadget2>%PROGRAMFILES%\Windows Sidebar\Gadgets\Calendar.Gadget</Gadget2>
<Gadget3>%PROGRAMFILES%\Windows Sidebar\Gadgets\Weather.Gadget</Gadget3>
</component>

Maybe we can find a best method?

Edited by myselfidem
Posted

When you say run batch following desktop loads this being before the sidebar is visible?

Excuse my english!

After Windows® Welcome, the "Preparing Your Desktop" screen appears for up to two minutes.

It's needed to see first the sidebar (visible and installed with Autounattend.xml) and after the batch file is launched and other programs (I use WPI).

And we will see our customized Gadgets after the reboot!

I keep the same order inside Autounattend.xml and Settings.ini for the Gadgets:

Settings.ini


[Root]
SettingsVersion="00.00.00.02"

ShowGalleryPrivacyStatementOnceComplete="true"
Section0="1"
Section1="2"
Section2="3"
[Hashes]
C:\Program Files\Windows Sidebar\Gadgets\Clock.Gadget="%7B196EB779-40FE-AE35-C357-36AACE0AA470%7D"
C:\Program Files\Windows Sidebar\Gadgets\Calendar.Gadget="%7BD3D8A841-CEE3-68C5-F99F-7302ABBBA0E3%7D"
C:\Program Files\Windows Sidebar\Gadgets\Weather.Gadget="%7B42DE9D91-AEE2-BAC6-FEE5-ADCC7B7904C4%7D"
...........

Autounattend.xml


</component>
<component name="Microsoft-Windows-Sidebar" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="[url="http://schemas.microsoft.com/WMIConfig/2002/State"]http://schemas.microsoft.com/WMIConfig/2002/State[/url]" xmlns:xsi="[url="http://www.w3.org/2001/XMLSchema-instance"]http://www.w3.org/2001/XMLSchema-instance[/url]">
<Gadget1>%PROGRAMFILES%\Windows Sidebar\Gadgets\Clock.Gadget</Gadget1>
<Gadget2>%PROGRAMFILES%\Windows Sidebar\Gadgets\Calendar.Gadget</Gadget2>
<Gadget3>%PROGRAMFILES%\Windows Sidebar\Gadgets\Weather.Gadget</Gadget3>
</component>

Maybe we can find a best method?

Then I reckon my problem here is the "runonce" is happening before the sidebar is fully loaded? I initiate the batch in my cleanup.cmd following runonceex for app installs. Slowing that up to allow the runonce to do it's thing has got me atm? WPI is not a happy camper in W7x64 so far for me.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...