WW Skin Installer WWS file creator

If you have created a skin for Weather Watcher and would like to share it with other users the best way to distribute it is to package it as a WWS file. This will ensure it gets installed into the proper Weather Watcher folder on the client’s machine. Unfortunately the steps to do this are not well documented and besides we all know how good we are about reading documentation. :icon_smile:

To facilitate creating a Weather Watcher Skin Installer file I have created a Command script to help you. It requires that you have WinZIP and it’s Command Line Support add-on installed.

To use, copy and paste the attached code to a text file on your hd, change the two WWSkin variables to point to your skin’s folders, save it as a .cmd file and execute it. It can be saved anywhere you would like the WWS file created, though I don’t recommend saving it in the same folder as the skin itself.

WWSskin.cmd[code]@echo off&Title Lazy Eds Weather Watcher Skin Installer WWS file creator&Color 17&MODE CON COLS=60 LINES=30
rem EdP
rem Requires the WinZIP Command Line Support Add-on.

::-------------------------------------
:: Manually CHANGE the following variables BEFORE running this script.
::-------------------------------------
:: WWSkinTYPE can be Forecasts, Icons, Interface or Tooltip. ie WWSkinTYPE=Interface
set WWSkinTYPE=

set WWSkinNAME=
:: WWSkinNAME is whatever name you gave to your skin’s folder. ie WWSkinNAME=Eds Classic

::-------------------------------------
:: Settings
::-------------------------------------
echo.
echo ****************************************
echo Setting up WWS environment
echo ****************************************
echo.

set WWSerror=no

:: set Weather Watcher Skins folder location

:: find path to installed Weather Watcher
:: (the line below has a [TAB] and two [SPACE] following delims=)
for /f "tokens=3* delims= " %%i in (‘reg query “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Weather Watcher_is1” /v InstallLocation’) do (
set WWInstall=%%~si
)

:: check if Weather Watcher path was found
if “%WWInstall%”==“” (
echo ERROR: Unable to find installed Weather Watcher
set WWSerror=yes
goto TheEnd
)

:: find path to installed wzzip
:: (the line below has a [TAB] and two [SPACE] following delims=)
for /f "tokens=3* delims= " %%i in (‘reg query “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WZZIP.exe” /ve’) do (
set wzzip=%%~si
)

:: check if wzzip path was found
if “%wzzip%”==“” (
echo ERROR: Unable to find installed WZZIP
set WWSerror=yes
goto TheEnd
)

:: set default program variables
set WWSkins=%WWInstall%Skins\

echo %WWSkins%%WWSkinTYPE%
echo %WWSkins%%WWSkinTYPE%%WWSkinNAME%
echo.

:: Validate WWSkin variables

if not exist %WWSkins%%WWSkinTYPE%*.* (
echo ERROR: WWSkinTYPE - %WWSkins%%WWSkinTYPE% NOT found.
set WWSerror=yes
goto TheEnd
)
if not exist %WWSkins%%WWSkinTYPE%"%WWSkinNAME%"*.* (
echo ERROR: WWSkinNAME - %WWSkins%%WWSkinTYPE%%WWSkinNAME% NOT found.
set WWSerror=yes
goto TheEnd
)

if exist WWS*.* rd /s /q “WWS”
md WWS > nul
md WWS%WWSkinTYPE% > nul

if exist My%WWSkinTYPE%Skin.old del My%WWSkinTYPE%Skin.old
if exist My%WWSkinTYPE%Skin.wws ren My%WWSkinTYPE%Skin.wws My%WWSkinTYPE%Skin.old
if exist My%WWSkinTYPE%Skin.zip del My%WWSkinTYPE%Skin.zip

echo.
echo ****************************************
echo Copy My Skin to the WWS folder
echo ****************************************
echo.
xcopy %WWSkins%%WWSkinTYPE%"%WWSkinNAME%" WWS%WWSkinTYPE%"%WWSkinNAME%" /s > nul

if exist WWS*.html del WWS*.html /S > nul
if exist WWS\Thumbs.* del WWS\Thumbs.* /A:HS /S > nul
if exist WWS*56?.* del WWS*56?.* /S > nul

echo.
echo ****************************************
echo Building MySkin.wws file
echo ****************************************
echo.

cd WWS
“%wzzip%” -p -r “…\My%WWSkinTYPE%Skin.zip” “.” > nul

cd …
ren My%WWSkinTYPE%Skin.zip My%WWSkinTYPE%Skin.wws

if %1! == ! rd /s /q “WWS”

:TheEnd
if “%WWSerror%”==“yes” pause
echo.
echo ****************************************
echo Finished
echo ****************************************
echo.
[/code]
You can of course perform the same steps manually using Windows Explorer and drag & drop but what fun is that? :iconbiggrin:

Update
Corrected line wrap on a couple of the longer lines. Added PAUSE if error found.

Merry Christmas!! :icon_smile: