Solved

Skip .bat installation if present

Posted on 2011-03-09
4
414 Views
Last Modified: 2012-05-11
I am planning to run a silent installation on my clients, using a .bat login script. How can I prevent the installation to start over the next time they log in? I of course can't remove the bat file before I am pretty sure it has been installed everywhere. I add this to my script:

@echo off
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"
0
Comment
Question by:happyhenrik
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
gavsmith earned 400 total points
ID: 35082703
Find one of the files that you know the install puts onto the computer. Then add:

@echo off
if exist "%systemdrive%\Program Files\Mailbox Central Outlook Addin\Somefile.ini" GOTO :ENDINSTALL
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"
:ENDINSTALL

Obvoiusly replace:
"%systemdrive%\Program Files\Mailbox Central Outlook Addin\Somefile.ini"
with the file you know should exist after install
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 100 total points
ID: 35082738
You could keep a flag file on your network drive where they have rights to add, e.g.

@echo off
if exist "\\10.218.110.21\Setup_Addin\log\ok\%computername%.txt" exit
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"

REM Check if error returned.  If not then log to OK dir.  If error then log to failed dir.
if "%errorlevel%"=="0" (
  echo Installed %date% %time% > "\\10.218.110.21\Setup_Addin\log\ok\%computername%.txt"
) ELSE (
  echo Failed with error %errorlevel% - %date% %time% > "\\10.218.110.21\Setup_Addin\log\failed\%computername%.txt"
)
Then you can also get a look at who has installed / failed to install

Otherwise you could do a registry check to see if already installed perhaps.

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 35082785
Cross posted there with first suggestion.  All depends what the software does during install but a file check, registry check for the MSI entries or similar is good for some, or you can use Group Policy to do the work for instance if you have Active Directory.

Otherwise a log file like suggested means you can see centrally who has run the update and when.
0
 

Author Comment

by:happyhenrik
ID: 35082827
gavsmith - it works like a charm, thx
dragon-it - thx for the tip ( I will reward you a little bit :-) )
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question