I don’t know where i am going wrong any assistance most welcome!!
Software is “Oracle SmartView” which (for some users) leaves behind ancient versions of itself in add/remove programs. It is MEANT to clean up after itself (and actually i can’t reproduce the whole “two versions in add/remove programs” issue myself… i just can see lots of users have the problem)…but the software is apparently terrible at doing that.
i currently use a fairly basic powershell script that doesn’t utilize PSADT to install the software utilizing “Start-Process” (it has a weird way of passing arguments to MSIexec inside the SmartView.exe in that you have to pass /v" /qn /L*v C:\path\to\log.log" noting the lack of a space between /v and the first double quote and arguments you want to pass in)… i want to start using PSADT because in my very limited understanding, it has this nice “remove-MSIApplications” cmdlet to nuke all previous versions of Oracle Smartview before installing the new one.
i prepare my system by first just installing SmartView.exe by double clicking the .exe, this works perfectly of course… i run the PSADT script (hopefully i can attach that somewhere here?..somehow?) it uninstalls via remove-msiapplications cmdlet, but using execute-process doesn’t install the new version… for some strange reason it tries to install the 32-bit office version every time??? (and fails every time)… additionally the vendor provided /X uninstall command i run before remove-msiapplications fails as well, with similar complaint about 32bit office version of SmartView… when i most definitely have x64 office installed and the version of SmartView i initially install is 64bit office.
Whats weird is i know this install command works in powershell and installs the correct 64bit version, (based on it working in the original non PSADT script) however if i run the command inside the PSADT script it fails in the same way attempting to install 32bit…i don’t understand why.
One of the most common issues seen in using Command Prompt commands in PowerShell is the use of the correct (and escaped) quotes, and the problem with the Oracle SmartView Command Line Instructions is it assumes you are running this command from a command prompt not Powershell, some of these commands won’t work natively in PowerShell, so they need modification.
Here is your command re-written with what should be the correct format to work in PowerShell:
N.B. Note the removal of the single quotes, commas (and extra spaces), and the path to the log file is wrapped in escaped (`) double quotes as the entire -ArgumentList content needs wrapping in double quotes, I have also put a space after the escaped double quotes (this is not required, but is there to show you two double quotes exist.
The advantage of escaped double quoting the log file path is the path can now contain spaces in it.
P.S. What is not clear from the Oracle guide is whether the /v is actually required if you are not specifying a different installation directory e.g. /v INSTALLDIR=C:\AltFolder", you may find the /v is not needed if you install to the default directory
And this reply to another thread by @That-Annoying-Guy also explains very well how escaping the quotes works:
… it’s only for some reason when i include that command (or what i am now using Execute-Process) in the PSADT script Deploy-application.ps1, does it go haywire and no longer work
i can even force the variables to the local scope by using double dots: . .\deploy-application.ps1watch the script fail to install smart view, and then run the Execute-process command in the powershell window that now has all the variables expanded, and it works just fine
So this actually works when run manually from the shell after the Deploy-application.ps1 has failed to install SmartView:
I realise this command would work with cmd but when stuffed into the execute-process or start-process we’d need to deal with all the double quote escaping goodness of powershell:
SmartView.exe /s /v" /L*v c:\install.log"
…But it’s an example of the type of formatting (specifically the no space between /v and the first double quote) that needs to be respected to allow passing of arguments to msiexec with this installer.
Alternative method would be extract Smartview.exe and use smartview.msi, however its bit extra work. We have to use office 32 bit installed machine separately and 64bit machine to extract corresponding msi files.
… something about that code (i suspect) seems to make the SmartView.exe be unable to determine if it’s a 32bit or 64bit install of Office, perhaps it actually tries to launch one of the office products or query it in some way? i’m not sure, it’s all “under the hood” of the SmartView.exe…
Anyway it is working now, i just thought i’d share the code (be forewarned my code is always rubbish, stolen from all over the internet etc.etc.)