Re: Need help with running vbs in Custom Action's Commit

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You're going to have to post your exact script. Are you sure that this is
your exact script? When I have this as a commit custom action it works fine:

set objShell = CreateObject("Wscript.Shell")
objShell.Run("notepad.exe")

so clearly it can get past the first CreateObject. If I had to guess, I'd
suspect that you are really using:

set objShell = WScript.CreateObject("Wscript.Shell")

because that WILL fail in a custom action and is a common error.

By the way, your script is wrong even if you get it working. The
objShell.Run is asynchronous, so all three regsvr32 runs will be in a timing
race, all running simultaneously, so you won't get them registered one after
the other you'll get them all at the same time.

It is extremely ususual for one Dll to require registration before another.
It implies that the registration code in one Dll requires the other Dll to
be already registered, so it looks like their registration code is doing
more than just writing its own registry entries. This is just a bad design
that probably looks ok to a non-setup developer but causes all kinds of
issues for an install.
--
Phil Wilson
[MVP Windows Installer]

"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:59A6B68B-A9A3-4BEB-A50E-1C4861ABDD11@xxxxxxxxxxxxxxxx
Hi Phil,
The error message is encounterd at the 1st line of the vbs code, set
objShell = CreateObject("Wscript.Shell"). I put a msgbox in front of
every
line of code and error was dispalyed right after the 1st msgbox output.
However, the vbs runs just fine by itself.
I am using MSI for my setup project in VS2005. For these 2 dlls, I would
need to have them registered in a certain order and I don't see the
selfReg
property offers that in MSI. Is there another place where I can specify
the
order of the dlls to be register in MSi? Thank you.
--
Thanks.


"Phil Wilson" wrote:

Try catching the error with an On Error and displaying the error message.

Why are you doing this? You're building the setup with some tool that
doesn't register for you? Visual Studio setups can do this for you with
the
Register property for the Dll in the setup project's IDE.
--
Phil Wilson
[MVP Windows Installer]

"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8F46DEEC-50B0-40E7-B0B5-606A351E3C92@xxxxxxxxxxxxxxxx
I just ran the vb script file with a message infront of each line for
testing
and it ran just fine and all message are displayed. I tried running
this
again from my setup's Custom Action's Commit, I get:
"There is a problem with this Windows Insatller Package. Acript
reqired
for
this install to complete could not be run. Contact your support
personnel
or
package vendor". Any idea what could cause this? Thank you.
--
Thanks.


"Pucca" wrote:

Hi,
I have the following vbs that gets put in the applicaiton directory
with
my
setup program. Becuase these 2 dlls have to be registered in a
certain
order. I don't think there is a way to specify that in the File
System
of my
Setup project. I use the following vb script and add it to the Custom
Actions' Commit stage. However, when I run set up I would keep
getting
error
that the script can not be run. If I double click the vbs file to run
it
manuly, it runs just fine. Does anyone know what could be causing
this?
Thank you.
set objShell = CreateObject("Wscript.Shell")
objShell.Run("regsvr32 /s somename.dll")
objShell.Run("regsvr32 /s 2ndfile.dll")

--
Thanks.





.



Relevant Pages

  • [ann] another way to call apis from script (the PB way)
    ... a dll and a typelib. ... you run the script, which will interface with a "standard" ... "COMforDLL" will work with a standard dll, ... work with win98 if I manually copied the winXP registry ...
    (microsoft.public.scripting.vbscript)
  • Re: printer setup through a script
    ... Is it somehow possible to change the printer setup with a script - e.g. ... Page Setup [Restore, No Window] ... to keep the original stored settings or replace them with the new ones (the ...
    (comp.databases.filemaker)
  • RE: SQL 2000 Upgrade REPLSYS.SQL error
    ... > upgrade again. ... > - Now the setup is failing while executing the replsys.sql script file with ... > - Rerun the setup with the new file. ... > - When it comes to the message.sql script, start SQL from a Command prompt ...
    (microsoft.public.sqlserver.setup)
  • Re: Embedding a VB script in DLL
    ... into a COM dll. ... the "microsoft script control" in your dll to run the ... you could compile your script ... you need a "resource compiler". ...
    (microsoft.public.scripting.vbscript)
  • Change local admin settings
    ... At the time, the simplest setup was to make each user a local admin, so ... and cross use PCs as need be. ... the logon script would hopefully add them back in before they'd ...
    (microsoft.public.windows.server.sbs)