Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

Skip .bat installation if present

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
happyhenrik
Asked:
happyhenrik
  • 2
2 Solutions
 
gavsmithCommented:
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
 
Steve KnightIT ConsultancyCommented:
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
 
Steve KnightIT ConsultancyCommented:
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
 
happyhenrikAuthor Commented:
gavsmith - it works like a charm, thx
dragon-it - thx for the tip ( I will reward you a little bit :-) )
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now