Jump to content

Weather gadget


Recommended Posts

I've made a new test successfully and it seems it is the best way!

We can use RunOnceEx, like this:

Clean.cmd


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\RunOnceEx
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Program Files\Windows Sidebar\sidebar.exe" /f
REGEDIT /S "%systemroot%\Setup\scripts\Tweaks.reg"

Tweaks.reg


Windows Registry Editor Version 5.00

;-------------------------
; - 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

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

Of course with this example the Desktop must be installed first and Gadgets installed with Autounattend.xml and after the reboot we will see our customized Gadgets!

The Autounattend.xml file creates the "Settings.ini" file during "Preparing the Desktop" and the batch file (clean.cmd) needs to be launched after the Desktop is installed! The "Settings.ini" file is replaced with our customized settings!

Edited by myselfidem
Link to comment
Share on other sites


I have no trouble with the ini file @ all. I got this working in an sfx using a similar reg entry for runonce as yours. Only problem is the weather gadget appears on the left top position following the change.

Easy enough to drag it back though annoying.

Link to comment
Share on other sites

That's odd! Could you attach your Settings.ini file, please?

*Edit:

1) You can try to use smaller size for the Gadgets!

2) Check if you have add Tweaks reg files with your customized Windows 7 and no correct value inside:

[HKEY_CLASSES_ROOT\DesktopBackground\Shell]

or

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell]

http://www.msfn.org/..._20#entry966749

Edited by myselfidem
Link to comment
Share on other sites

Thanks!

I think you can remove inside your Settings.ini file and Missing Section0="1":

[Root]

LayoutPosition=Default (you can remove this line)

Your choice for the order: 1 Calendar; 2 Weather; 3 Clock; 4 CPU and 5 RSSFeeds ; like your Autounattend.xml file order!

The Settings.ini file must look like this (Section [Root] at first, etc.):

Here is mine Settings.ini file customized:


[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"
[Section 1]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CClock.Gadget"
PrivateSetting_GadgetDropLocationX="1120"
PrivateSetting_GadgetDropLocationY="0"
PrivateSetting_GadgetSize="small"
SettingsExist="True"
themeID="0"
timeZoneIndex="-1"
timeZoneBias="1000"
timeZoneDSTBias="1000"
secondsEnabled="True"
[Section 2]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CCalendar.Gadget"
dockedCalendarView="DAY_DOCKED"
dockedCalendarDivType="day"
unDockedCalendarView="MONTH_UNDOCKED"
PrivateSetting_GadgetDropLocationX="1120"
PrivateSetting_GadgetDropLocationY="140"
PrivateSetting_GadgetSize="small"
[Section 3]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CWeather.Gadget"
LocationAPIAvailable="True"
CurrentState="6"
WeatherLocation="Gen%E8ve,%20CHE"
WeatherLocationCode="wc:SZXX0013"
DisplayDegreesIn="Celsius"
PrivateSetting_GadgetDropLocationX="1120"
PrivateSetting_GadgetDropLocationY="291"
PrivateSetting_GadgetSize="small"

Your Settings.ini file modded and I think it will works:


[Root]
SettingsVersion="00.00.00.02"

ShowGalleryPrivacyStatementOnceComplete="true"
Section0="1"
Section1="2"
Section2="3"
Section3="4"
section4="5"
[Hashes]
C:\Program Files\Windows Sidebar\Gadgets\Calendar.Gadget="%7B5418EBBA-C477-C961-A564-5ADA4B675E86%7D"
C:\Program Files\Windows Sidebar\Gadgets\Weather.Gadget="%7B7FA60BC7-F0F9-E9AB-B412-D0C5BCC9572A%7D"
C:\Program Files\windows sidebar\gadgets\Clock.Gadget="%7B05019D90-B4CE-8DA2-F819-426943D29156%7D"
C:\Program Files\Windows Sidebar\Gadgets\CPU.Gadget="%7BC8CB3A22-A811-1023-DE70-4F59397E552E%7D"
C:\Program Files\Windows Sidebar\Gadgets\RSSFeeds.Gadget="%7B021FF6A8-C57F-F933-7D89-F1AEA956FD65%7D"
[Section 1]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CCalendar.Gadget"
dockedCalendarView="DAY_DOCKED"
dockedCalendarDivType="day"
unDockedCalendarView="MONTH_UNDOCKED"
PrivateSetting_GadgetDropLocationX="1760"
PrivateSetting_GadgetDropLocationY="0"
PrivateSetting_GadgetSize="small"
[Section 2]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CWeather.Gadget"
LocationAPIAvailable="True"
CurrentState="6"
WeatherLocation="Sydney,%20AUS"
WeatherLocationCode="wc:ASXX0112"
DisplayDegreesIn="Celsius"
PrivateSetting_GadgetDropLocationX="1760"
PrivateSetting_GadgetDropLocationY="151"
PrivateSetting_GadgetSize="small"
[Section 3]
PrivateSetting_GadgetName=%25PROGRAMFILES%25%5Cwindows%20sidebar%5Cgadgets%5CClock.Gadget
PrivateSetting_GadgetDropLocationX="1760"
PrivateSetting_GadgetDropLocationY="245"
PrivateSetting_GadgetSize="small"
SettingsExist="True"
themeID="0"
timeZoneIndex="-1"
timeZoneBias="1000"
timeZoneDSTBias="1000"
secondsEnabled="True"
[Section 4]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CCPU.Gadget"
PrivateSetting_GadgetDropLocationX="1760"
PrivateSetting_GadgetDropLocationY="385"
PrivateSetting_GadgetSize="small"
[Section 5]
PrivateSetting_GadgetName="C:%5CProgram%20Files%5CWindows%20Sidebar%5CGadgets%5CRSSFeeds.Gadget"
PrivateSetting_GadgetDropLocationX="1760"
PrivateSetting_GadgetDropLocationY="496"
PrivateSetting_GadgetSize="small"

*Edit: some problems may occur with some Slideshow Gadgets downloaded on Web sites!

http://www.sevenforu...lt-gadgets.html

On your Computer, open Settings.ini and remove this line (Takeownership on the file):

[Hashes]

C:\Program Files\windows sidebar\gadgets\SlideShow.gadget="%7BF07B860D-E825-6640-3F54-C1D2B050D5E6%7D"

*Edit: post updated for PrivateSetting_GadgetDropLocationY="values"

Edited by myselfidem
Link to comment
Share on other sites

OK used the ini you suggested, no attributes. I generally only have the Clock, CPU & Weather gadgets enabled & adjusted ini to suit. It still ended up with all the gadgets arranged to the left on top of one another!

I added a ping of 30seconds to my sfx to slow the operation of ini file swap & restart & that has helped :yes:. I only have a very slight overlap of the clock & CPU gadget on the right now. I'm thinking this may have some to do with the VM Box resolution & not necessarily a windows problem.

Will try now in real install.

Edited by MAVERICKS CHOICE
Link to comment
Share on other sites

Oh sorry, I've made errors because I've made your Settings.ini file manually and the positions aren't correct!!!

Values inside: PrivateSetting_GadgetDropLocationY="value"

I think it's needed to keep the same resolution screen:

PrivateSetting_GadgetDropLocationX="1120" or PrivateSetting_GadgetDropLocationX="1760" or others for the destination screen!

I've updated my last post... But check your Settings.ini file if it's OK!

When we change the order, the value for the GadgetDropLocationY change!

However, it's better to have the Settings.ini file made by Windows! We can close all the Gadgets and set a new time the Gadgets we want and save the Settings.ini file.

I think, it's better to keep the attributes: +A +I

Edited by myselfidem
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the suggestion, did try that but the selected gadgets will appear though not with the correct settings. eg. His method is basically what I started with prior to swapping the ini file.

I played further with my ini file & have adjusted the Y coordinates now as follows: 1. Clock Gad GadgetDropLocationY="0" 2. Weather Gad GadgetDropLocationY="180" 3. CPU Gad GadgetDropLocationY="270" Naturally have the Clock top left & set @ zero.

With the above minor adjustments only by 20 points to both Weather & CPU they seem to positon nicely in the Virtual machine whilst testing. Real install will follow.

Would like to clean up the initiation of the sidebar process though as in my case it's very messy! Especially so using runonceex. I can see why your using WPI as there's greater control & a fully loaded desktop upon installation.

I have been using the latest WPI but does conflict with a few other installers, must admit the latest ver. is alot better. WPI was always fantastic in XP but not quite right in W7.

Link to comment
Share on other sites

In fact, to hide the command window I use a .vbs script, like this:

clean.vbs


' Hide the command window (clean.cmd)

Set WshShell = WScript.CreateObject("WScript.Shell" )
WshShell.Run "%SystemRoot%\Setup\Scripts\clean.cmd" ,SH_WIDE ,true

Using: $OEM$\$$\Setup\Scripts

Link to comment
Share on other sites

After many tests, I found another method to have Gadgets customized on the Desktop when the silent installation is complete!

1) Set the wanted Gadgets on your computer with your prefered settings

2) Select: Options = Show hiden files and folders

3) Browse to C:\%userprofile%\AppData\Local\Microsoft\Windows Sidebar\

4) Copy/paste the Settings.ini file inside a folder of your choice

5) Mount the image install.wim you want customize with DISM

6) Copy the Settings.ini file inside: %SystemDrive%\%Mounted_Folder%\Programs\Windows Sidebar\Settings.ini (remove the existing one)

7) No need to add the settings for Gadgets inside your Autounattend.xml (But you can add if you want)

8) Unmount /Commit

9) Add also this registry reg:

You can use SetupComplete.cmd and set your Tweaks registry file (Example: Gadgets.reg) inside: \%DVD%\sources\$OEM$\$\Setup\Scripts\

SetupComplete.cmd


@echo off
REGEDIT /S "%systemroot%\Setup\Scripts\Gadgets.reg"
EXIT

Gadgets.reg


Windows Registry Editor Version 5.00

;-------------------------
; - 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
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DesktopBackground\Shell\Gadgets\command]
@="\"C:\\Program Files\\Windows Sidebar\\sidebar.exe /showGadgets""

;--------------------------------------------------------
; - Allows installation for unsigned Gadgets -
;--------------------------------------------------------
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Sidebar\Settings]
"AllowElevatedProcess"=dword:00000001

* 10) You can also create the folder scripts inside the Mounted image: \%Mounted_Folder%\Windows\Setup\scripts (Set inside: SetupComplete.cmd and Gadgets.reg)

With this method, you don't need $OEM$ folders!

After the silent installation is complete you will see that the Settings.ini file inside "%userprofile%\AppData\Microsoft\Windows Sidebar\ Settings.ini" is the same customized file set inside:

"%SystemDrive%\Programs\Windows Sidebar\Settings.ini"

Works fine!

Edited by myselfidem
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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