Preparing a batch script to uninstall and reinstall a program
Hi Experts,
we are running a client app on 100 numbers of windows server 2003 R2 64 bit, now an upgraded version comes and client asking us to do reinstall that on all those servers. Here is the text flowchart of that batch script which i m planning to create to automate this.
1. uninstall that program (but no user intervention is required).
2. Reboot the server.
3. install the latest version.
4. copy 3 config file to installed program directory (files are already there but the one we copying is upgraded one).
5. Reboot the server again.
But i got stuck on first point, i tried
msiexec /x path_app.msi /q
it does nothing, then i remove Quiet switch but now it is asking Yes/No option for removal
Please help..
Windows BatchWindows Server 2003Microsoft Server OS
Last Comment
pdixit1977
8/22/2022 - Mon
becraig
Did you check the eventlog on the server you ran against with the /q flag to see what entry was in the event log for the msi installer source ?
This will help you know what happened when you ran with the /q flag so we can determine how to resolve this.
pdixit1977
ASKER
i checked that and there is nothing in event logs..
becraig
you may want to look into c:\temp on the target server to see if any logs were generated.
It seems the msi installer was not invoked if you are not seeing any msi entries in the eventlog.
I tried
msiexec /x app.msi /passive /log C:\temp\logfile.txt
but it neither uninstalled the app NOR log something
msiexec /x path_app.msi /l path to some logfile asking for user intervention yes/no
i already tried /q and /quiet but that also not worked for me..
becraig
This is the strangest case I have ever heard, did the Application log on the computer this was run against show any msi installer entries for any of the commands you ran ?
is this one particular application btw, could always be that for some reason it won't allow/accept such uninstalls?
Does the msiexec task still continue running in task manager, or if you start it from cmd.exe does it return control straight away or show anything?
Steve
becraig
Steve has a good point I would also try running the command from the command line on one of the servers to see what the command line returns.
As for what logging options exist and what does what, see below:
Windows Installer handles its installations through Msiexec.exe. The logging options offered by this tool allow you to create different types of logs, depending on the information you need about the installation. These options are:
i - Status messages
w - Nonfatal warnings
e - All error messages
a - Start up of actions
r - Action-specific records
u - User requests
c - Initial UI parameters
m - Out-of-memory or fatal exit information
o - Out-of-disk-space messages
p - Terminal properties
v - Verbose output
x - Extra debugging information
+ - Append to existing log file
! - Flush each line to the log
* - Log all information, except for v and x options
you get that error if the path to the msi is not reachable from the location the command is being called.
There are other potential issue but I think that is it, please ensure the msi is present in the location specified when running...
e.g. If running on a remote server copy the msi to c:\temp on that server then run via invoke-command or psexec msiexec c:\temp\file.msi
pdixit1977
ASKER
i tried some other application installation and uninstallation with they way you guys suggest and they all were installed and uninstalled successfully but only this MSI giving error.
i m going back to client to ask another copy of MSI and also validate if they put any restrictions in code to not to install via command..
This will help you know what happened when you ran with the /q flag so we can determine how to resolve this.