[wpkg-users] Push Install WPKG with Psexec

chiddie claudio.ghirardi at geniaware.com
Tue Dec 13 14:56:58 CET 2011




David Petterson wrote:
> 
>> If you can "pass" me that script i will be more than happy to use it
>> instead
>> of wasting hours trying to make psexec work with wpkg client. :)
> 
> I use a two parted script for this, they are not very pretty, but they 
> work! I have plans to do a version check to be able to upgrade the WPKG 
> client to the latest version, but since I can upgrade the WPKG client by 
> using WPKG, it is not that critical.
> I made them when I upgraded from WPKG client version 1.2 to 1.3.9, and 
> the upgrade failed on several clients.
> 
> The first script called wpkg.cmd is called by my startup.cmd and will 
> check that a 64-bit system does not run a 32-bit client. It will send a 
> mail using "blat" to an address you specify, using an existing 
> SMTP-server in your system. If you dont want that, just remove the two 
> lines before GOTO :EOF.
> Previously I also set autostart to delayed autostart, but after a while 
> I changed it back since it conflicted with Windows Update also starting 
> delayed. It will also change the dependens for the service to make sure 
> that the network is started before WPKG runs. This was a big problem 
> with Windows 7, and WPKG run very badly without a network! ;)
> 
> The second script is located on another server, but can run from 
> wherever you put the MSI files and the config xml.
> I have not upgraded to the latest WPKG client, because I have had bad 
> experience upgrading the client before, and I dont want to fix what aint 
> broken.
> 
> If any of you have ideas how to make it better, please share! :)
> 
> /David
> 
> -- 
> David Petterson <david at ifm.liu.se>		Phone: +46(0)13-28 2617
> Systems Administrator
> Department of Physics, Chemistry and Biology at Linköping University
> Office: F F202
> SE 581 83 Linköping, Sweden
> 
> @ECHO OFF
> SET INSTFOLDER=%~dp0
> :: This is a workaround for supid Microsoft variable with paranteses
> SET PROGRAMFILESX86=%PROGRAMFILES(x86)%
> 
> :: Remove older WPKG Client versions
> :INSTALL
> taskkill /f /im WPKGSrv* >NUL 2>&1
> msiexec /qn /norestart /X {44123645-AAE1-4265-9052-AAA52C9F87BB}
> msiexec /qn /norestart /X {FD883F05-6D6B-4E81-8FD7-B209FEF750CD}
> msiexec /qn /norestart /X {9D07059A-EC99-4F03-9BF2-BE40FB007822}
> msiexec /qn /norestart /X {6E5D73C8-AF0F-40EC-98DD-4D428D53ABCA}
> 
> :: Remove registry parts from partially removed installs
> REG DELETE
> "HKEY_CLASSES_ROOT\Installer\Products\A95070D999CE30F4B92FEB04BF008722" /f
> >NUL 2>&1
> REG DELETE
> "HKEY_CLASSES_ROOT\Installer\Products\8C37D5E6F0FACE0489DDD424D835BAAC" /f
> >NUL 2>&1
> REG DELETE
> "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{44123645-AAE1-4265-9052-AAA52C9F87BB}"
> /f >NUL 2>&1
> REG DELETE
> "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{9D07059A-EC99-4F03-9BF2-BE40FB007822}"
> /f >NUL 2>&1
> 
> :: Remove System Service
> SC delete "WpkgService" >NUL 2>&1
> REG DELETE
> "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\1CF6FA8354D63926028B4E3ECC30D557"
> /f >NUL 2>&1
> 
> :: Remove WPKG files
> IF EXIST "%PROGRAMFILESX86%\wpkg" RMDIR /S /Q "%PROGRAMFILESX86%\wpkg"
> IF EXIST "%PROGRAMFILES%\wpkg" RMDIR /S /Q "%PROGRAMFILES%\wpkg"
> 
> 
> IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (SET CPU=x64) ELSE (SET CPU=x86)
> msiexec /qn /norestart /I "%INSTFOLDER%WPKGClient1.3.9-%CPU%.msi"
> SETTINGSFILE="%INSTFOLDER%settings.xml"
> 
> :: Fix for Windows 7, change to delayed start with added dependencies
> ::sc config wpkgservice depend= NSI/Tdx/Afd/tcpip/TermService start=
> delayed-auto
> ver | FIND /I "Version 6"
> IF "%ERRORLEVEL%" == "0" (
> 	sc config wpkgservice depend= NSI/Tdx/Afd/tcpip/TermService start= auto
> )
> 
> @ECHO OFF
> 
> :: Make sure 32 bit WPKG is not installed on 64 bit clients
> IF EXIST "%PROGRAMFILES(x86)%\WPKG\WPKGSrv.exe" (
> 	:: (re)Install WPKG
> 	CALL \\PATHTOINSTALLER\install_wpkg.cmd
> 	ECHO %COMPUTERNAME% %DATE% %TIME% WPKG was reinstalled>
> "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log"
> 	IF EXIST "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log" CALL
> \\PATHTOTOOLS\tools\blat.exe "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log"
> -to sysadmin at somewhere -f wpkg at somewhere -s "wpkg: %COMPUTERNAME% not
> installed" -server <smtpserver> -debug -log %temp%\blat.log -timestamp
> 	GOTO :EOF
> )
> 
> :: Make sure WPKG is installed
> IF NOT EXIST "%PROGRAMFILES%\WPKG\WPKGSrv.exe" (
> 	CALL \\PATHTOINSTALLER\install_wpkg.cmd
> 	ECHO %COMPUTERNAME% %DATE% %TIME% WPKG was not installed>
> "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log"
> 	IF EXIST "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log" CALL
> \\PATHTOTOOLS\tools\blat.exe "%TEMP%\wpkg-%COMPUTERNAME%-statuscheck.log"
> -to sysadmin at somewhere -f wpkg at somewhere -s "wpkg: %COMPUTERNAME% not
> installed" -server <smtpserver> -debug -log %temp%\blat.log -timestamp
> 	GOTO :EOF
> )
> 
> :: Make sure WPKG is set to automatic
> ::sc config wpkgservice depend= NSI/Tdx/Afd/tcpip/TermService start=
> delayed-auto>NUL 2>&1
> 
> ver | FIND /I "Version 6">NUL 2>&1
> IF "%ERRORLEVEL%" == "0" (
> 	sc config wpkgservice depend= NSI/Tdx/Afd/tcpip/TermService start=
> auto>NUL 2>NUL
> ) ELSE (
> 	sc config WpkgService start= auto>NUL 2>NUL
> )
> 
> 
> -------------------------------------------------------------------------
> wpkg-users mailing list archives >>
> http://lists.wpkg.org/pipermail/wpkg-users/
> _______________________________________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/wpkg-users
> 
> 
Mmm, there are things i don't get in these scripts:

assuming that you have a Windows XX domain forest and that for me "it's the
first time" (aka = all my WPKG clients installs will be fresh installs and
no upgrades), why bothering uninstalling the old WPKG client versions (+
registry keys) before installing the new one? Do the new versions not
upgrade automatically the old ones installed on the clients?

If this is the case it's enough to invoke wpkg.js (with the appropriate
parameters) using logon scripts functions of active directory policies in
order to install the program on the clients:

================================================================ 
1. Create a package called WPKG_Client or something like that 
2. Modify the package provided in the wiki page
"http://wpkg.org/WPKG_Client" (Group Policy WPKG mix section) changing data
to match the last wpkg_client version avaiable (1.3.14 as of now): 
* in the check tipe file = condition line modify the value in 1.0.0.22 
* in the remove line modify the uninstall string in
{0FAE4D7E-551C-4C50-8935-C05408A49A73}. WARNING: THIS STRING REFERS TO THE
1.3.14 X64 CLIENT INSTALLER. IF YOU HAVE TO DEPLOY THE X32 VERSION, YOU HAVE
TO GO TO THE REGISTRY OF A MACHINE WITH THAT VERSION INSTALLED AND CHECK FOR
THE RIGHT STRING (you can find it  by searching the string "Artur Majuch"
and then looking in the uninstallString row in that registry folder). 
3. Open the policy you want to modify by adding the script to deploy the
wpkg client (the global domain policy in my case, but you can create
another, of course, if yoy want). 
4. Go to Computer Configuration -> Windows Settings ->
Scripts(startup/shutdown) -> Startup 
* Script: \\myserver\myshare\wpkg.js (network path where the wpkg.js is) 
* Parameters: /install:package_id /quiet /nonotify (package_id is the id of
the package just created in point 1) 
5. Save and you're done. 
=============================================================== 

Notice that i understand that i have less problems since not only mine is a
fresh install, but all my clients are x64. In any case, the new WPKG Server
version 1.3 introduces the possibility to check if the client is x32 or x64.
Using this new check, you could adapt the wiki script above in order to
deploy the correct version of the WPKG client basing on the client
architecture.

The only thing that this type of deployment cannot do (i'm trying to
understand why with the help of this mailing list) is starting the WPKG
Service after having installed or upgraded it (so it will require a client
reboot in order for the service to start).
-- 
View this message in context: http://old.nabble.com/Push-Install-WPKG-with-Psexec-tp32930057p32966428.html
Sent from the WPKG - Users mailing list archive at Nabble.com.




More information about the wpkg-users mailing list