problem with Active Setup = Wallpaper

80 views
Skip to first unread message

Jáder Marasca

unread,
Feb 15, 2017, 7:17:51 PM2/15/17
to wpk...@googlegroups.com
Hi

I've created a working package to change wallpaper on all windows WHEN user has no rights to change it (non admin).
It's here:

<packages>
<package
  id="PapelParede"
  name="Papel de Parede Corporativo"
  revision="%VERSAO%"
  execute="once"
  priority="0" >
  reboot="false"
  priority="1">

    <variable name="VERSAO" value="2017-01-28" />
    <check type="file" condition="exists" path="c:\util\PapelParede_%VERSAO%.txt" />

    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /v "Version" /d "%VERSAO%" /t REG_SZ /f' />
    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /v "StubPath" /d "\\servidor\netlogon\PapelParede.bat %VERSAO%" /t REG_EXPAND_SZ /f' />
    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /v "@" /d "Papel de Parede Corporativo" /t REG_SZ /f' />


    <upgrade include="install"/>

    <remove timeout="15" cmd='%COMSPEC% /C del /q "c:\util\PapelParede_*.txt"'/>
    <remove timeout="60" cmd='reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /f' />


I just have one problem (hehehe): I cannot have it to verify it's installed!
My check condition APPEARS to be working (it's just a file check!)
My batch called from StubPath works (I've run it manually and it works).
This batch change wallpaper using this:

"
@echo off
set VERSAO=%1

reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f >NUL
reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "\\servidor\netlogon\PapelParede.bmp" /f >NUL
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "\\servidor\netlogon\PapelParede.bmp" /f >NUL
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v TileWallpaper /t REG_SZ /d 0x00000000 /f >NUL
REM reg delete "HKCU\Software\Microsoft\Internet Explorer\Desktop\General" /v WallpaperStyle /f >NUL
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_SZ /d 0x00000000 /f >NUL
reg add "HKEY_CURRENT_USER\Control Panel\Colors" /v Background /t REG_SZ /d "00 80 00" /f >NUL
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters >NUL

echo %VERSAO% >  c:\util\PapelParede_%VERSAO%.txt
"

So... all parts works... but the last command do not executes WHEN runned by system on ActiveSetup.
I'm not sure if it's a BIOS problem  (ME!), a ActiveSetup problem, or something I just do not understand on ActiveSetup mechanism!
Have someone already used it ?

BTW: I do know how to name the JOB of ActiveSetup, I see it as (Standard) and as first item on regedit when looking for other ActiveSetups IDs. But I'm unable to mimic that! Any tips is appreciated. I've created a entry using "@" on regedit last command of package!

Regards


Jáder Marasca

+55.051.4063.7407 (VoIP)         +55.083.99811.9170 (Tim) 
+1.305.791.3265 (Google)        skype: jader.marasca   

Jáder Marasca

unread,
Feb 15, 2017, 7:57:40 PM2/15/17
to wpk...@googlegroups.com
I've updated my package, so here is the new one:

<packages>
<package
  id="PapelParede"
  name="Papel de Parede Corporativo"
  revision="%VERSAO%"
  execute="once"
  priority="0" >
  reboot="false"
  priority="1">

    <variable name="VERSAO" value="20170129" />
    <check type="file" condition="exists" path="c:\util\PapelParede_%VERSAO%.txt" />

    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /d "Papel de Parede Corporativo" /t REG_SZ /f' />
    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /v "Version" /d "%VERSAO%" /t REG_SZ /f' />
    <install timeout="60" cmd='%COMSPEC% /c copy /y "\\servidor\netlogon\PapelParede.bat" "c:\util\" ' />
    <install timeout="60" cmd='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect" /v "StubPath" /d "c:\util\PapelParede.bat %VERSAO%" /t REG_EXPAND_SZ /f' />


    <upgrade include="install"/>

    <remove timeout="15" cmd='%COMSPEC% /C del /q "c:\util\PapelParede_*.txt"'/>
    <remove timeout="60" cmd='reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\PapelParedeAntinsect"  /f' />

</package>
</packages>

CHANGELOG ? 
a) Version number is date in international format WITHOUT dashes. 
b) Batch PapelParede.bat now runs from C: not from NETLOGON dir on samba.
c) find out how to name my ActiveSetup script : using NO /v parameter. See first reg add command)

This appear take TWO executions to work... but APPEARS to work.
I'll return to you next week.

Regards,

Jáder


Jáder Marasca

+55.051.4063.7407 (VoIP)         +55.083.99811.9170 (Tim) 
+1.305.791.3265 (Google)        skype: jader.marasca   

Reply all
Reply to author
Forward
0 new messages