Launch a Windows Installer shortcut from a vb script

G

Guest

Is there a way to run a Windows Installer shortcut from a vbscript? I do not
want to run the .exe because I want the self healing properties of the
Windows Installer shortcut.
 
A

Anthony Hunter

You can use the following command line.

msiexec.exe /i <msi filename>



Anthony
 
J

JFHENSENS

Hi!

I'm working on a similar project. I have to display a message (a smal
.hta file) to the user before launching Microsoft Access XP. But I wan
to keep the Self-Healing functionality available.

So, I've replaced the 'Microsoft Access.lnk' file with a shortcut whic
launch a vbscript and I've modified the association type of .mdb file
in the same way that I've done with the shortcut.

Below, you will find the script part (lightened) which is execute
after the message has been closed by the user.

It creates an instance of the Microsoft Access XP application which i
intercepted by the Windows Installer service... The same kind o
process used by windows installer shortcuts. I've found thi
information on the following web page :

'COM Resources' (http://www.zerog.com/ianetmanual/COM_V.html)

the user executes a script that contains the following line:
oobj = createobject(\"myserver.mylib\")

the windows installer service 'intercepts' the request for an instanc
of the object, and based on settings contained in the installation
verifies that all key members of components provided by the featur
listed in the com tables are properly installed. since the file is no
found, the windows installer service reinstalls the appropriate feature
then allows the instance of the server to be created and handed back t
the calling script.

Here is the script I've written...

option explicit

dim objarguments, objaccess, fso
dim strfilepath
dim intcount, i


on error resume next

set objarguments = wscript.arguments

intcount = objarguments.count

select case intcount
case 0
strfilepath = empty
case else
for i = 0 to intcount - 2
strfilepath = strfilepath & objarguments(i) & \" \"
next

strfilepath = strfilepath & objarguments(i)
end select

set objarguments = nothing


set objaccess = createobject(\"access.application.10\")

if err.number <> 0 then
wscript.quit 1
end if

objaccess.visible = true

if not isempty(strfilepath) then
set fso = createobject(\"scripting.filesystemobject\")

if fso.fileexists(strfilepath) then
objaccess.opencurrentdatabase(strfilepath)
end if

set fso = nothing
end if


do while objaccess.visible
wscript.sleep 1000
loop

set objaccess = nothing

That's all I've found concerning this matter. If you have foun
something else, please let me know...

Kind regards,

Jean-Fran&ccedil;oi


-
JFHENSEN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top