Help - Search - Members - Calendar
Full Version: How to check if an application is installed?
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   
Google Internet Forums Unattended CD/DVD Guide
motherfok
I figured a good way to install an application on multiple machines, is to put instructions for it in the login script that these machines use. However, this way the application will be installed every time the user logs on. What are some good ways of detecting if the application has been installed yet? (and if so: skip the installation)

Perhaps checking for specific registry entries, or files that are unique to that version of a certain application.... Anything else? How would you do it? (code please newwink.gif)
mmarable
I'd keep it simple. Check for the executable in the lcoation that you're intalling it to. If it's there, skip the install, if not install it.

That's the simple way.
motherfok
QUOTE (mmarable @ Nov 2 2005, 04:10 PM) *
I'd keep it simple. Check for the executable in the lcoation that you're intalling it to. If it's there, skip the install, if not install it.

That's the simple way.


Actually it's an update to an application. Executable names of both versions are the same.. blushing.gif
ravashaak
You could use REG.exe to check a specific registry entry. Type REG QUERY at the command prompt for further syntax information. You could pipe the results into a FIND command to verify installation. You could also check the %errorlevel% system variable immediately after the REG QUERY in order to verify installation.

If there are no appropriate registry entries to be checked, a last resort is to use FILEVER.exe to determine the version of the executable.

- Ravashaak
ZileXa
WIHU can do this for you (and adjust the selectable options if a certain program (or regkey) is present.)
cwyhk
I use the following batch files to install and update applications
on both Window Me clients and Windows XP clients
in windows 2000 server network environment.

My method is based on computer name of each clients
rather checking the version of the applications.

logon.bat

net use I: \\server1\f1
net use J: \\server1\f2
net use F: \\server2

net time \\server1 /set /yes

if (%OS%) == (Windows_NT) goto XP
if exist F:\PROUP\SU.BAT start R:\PROUP\SU.BAT
goto end

:XP
if exist F:\PROUP\SU.BAT call R:\PROUP\SU.BAT

:end
exit

Click to view attachment

SU.BAT

set drive=R:

%drive%
cd %drive%\proup

if not exist c:\cname.bat start /wait ComputerName.vbs
call c:\cname.bat

set dir=SU1
if not exist %dir%\%cn% goto next1
if exist %dir%\%cn%.done goto next1
cd %dir%
for %%U in (*.bat) do call %%U
echo %cn% > %cn%.done
cd ..
:next1

set dir=SU2
if not exist %dir%\%cn% goto next2
if exist %dir%\%cn%.done goto next2
cd %dir%
for %%U in (*.bat) do call %%U
echo %cn% > %cn%.done
cd ..
:next2

:end
cls
@exit

Click to view attachment


ComputerName.vbs

Set objShell = Wscript.CreateObject("Wscript.Shell")
Set colSystemEnvVars = objShell.Environment("System")
Set colUserEnvVars = objShell.Environment("User")
Set objNetwork = Wscript.CreateObject("Wscript.Network")

UName = objNetwork.UserName
CName = objNetwork.ComputerName

Set WShell = CreateObject("WScript.Shell")

Call WShell.Run ("command /c echo set cn=" & cname & "> c:\cname.bat",,True)
WScript.DisconnectObject(WShell)
Wscript.Quit

UP.BAT

if (%OS%) == (Windows_NT) goto XP

:ME

if exist "C:\Program Files\7-Zip\Uninstall.exe" start /wait "C:\Program Files\7-Zip\Uninstall.exe" /S
ping locahost > NUL
goto end

:XP

if exist "%ProgramFiles%\7-Zip\Uninstall.exe" start /wait "aa" "%ProgramFiles%\7-Zip\Uninstall.exe" /S
ping locahost > NUL
:end

start /wait Seven-Zip\7z429.exe /S

regedit /s Seven-Zip\7-Zip.reg
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.