Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Installing, updating and removing two msi files in one action.

 
Ranch Hand
Posts: 974
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple assignment, and after one week, and yes I feel ashamed, I still have not found the solution... The task is very simple. The customer has to install/update two msi files. But, they are lazy, and want to do it with one click. I have come over tons of information about nested msi. Advice not to use that. I tried to use Installshield. It installed, but did not update nor removed correctly. I have thought about just calling two msi installs from a command script but there is not real easy way to let the second msi wait for the first msi install to finish. I am getting a little frustrated now, and depressed. Such a simple assignment and I am still pondering about the solution. Is there any simple solution? For your interest, even the order in which these installs are run, is not that important. It are quite independent things. The only requirement is that install, remove and update goes in one action.
 
Jan de Boer
Ranch Hand
Posts: 974
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I made this goofy but efficient solution. There is an overwhelming chunk of information for this problem, and the packages like installshield are just bloated. This is simple and short and good enough I think. It's just a bit of vbscript.

set fso = CreateObject("Scripting.FileSystemObject")

dim currentDir
currentDir = fso.GetAbsolutePathName(".")
set oFldr = fso.getfolder(currentDir)

for each ofile in oFldr.Files
if lcase(ofile.name) = "setup.ex_" then
ofile.name = "setup.exe"
end if
if lcase(ofile.name) = "mymsi.ms_" then
ofile.name = "mymsi.msi"
end if
next


dim arrMSI(1)

arrMSI(0) = "msiexec /i mymsi.msi /norestart"
arrMSI(1) = "setup.exe"


for each item in arrMSI

'run each program (or in your case MSIEXEC command), wait till exit.
'If installer returns exit code 0, then continue to next

set WshShell = WScript.CreateObject("WScript.Shell")
return = WshShell.Run(item,1,true)

if return <> 0 then

wscript.echo item & " failed. Script will now abort."
wscript.quit

end if

next


set fso = CreateObject("Scripting.FileSystemObject")

set oFldr = fso.getfolder(currentDir)

for each ofile in oFldr.Files
if lcase(ofile.name) = "setup.exe" then
ofile.name = "setup.ex_"
end if
if lcase(ofile.name) = "mymsi.msi" then
ofile.name = "mymsi.ms_"
end if
next
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic