Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Setup / May 2005

Tip: Looking for answers? Try searching our database.

Custom Action VB Script

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aro - 10 Aug 2004 11:13 GMT
Hi folks,

I am trying to read the installation path using a VB Script. In fact, I
can already do that easily by using the script and the
"CustomActionData" property. The problem I have is that this
CustomAction is supposed to run between InstallInitialize and
InstallFinalize in the InstallExecuteSequence table.

I need this script to run before InstallInitialize. Anything later than
that is simply too late for me(the changes that I make to the .msi are
ignored). If I change the sequence and put it before InstallInitialize I
get an error.

Does anyone know how I could get the installation path before
InstallInitialize runs ? Please help. Thanks.
Phil Wilson - 10 Aug 2004 15:56 GMT
You'd need to make it an immediate custom action instead of deferred (take
1024, msidbCustomActionTypeInScript, out of the Type), then you can sequence
it early in the execute sequence, if that works for you. You won't need
CustomActionData if it's immediate, just use the TARGETDIR property.
Signature

Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/104-7044380-4696760

> Hi folks,
>
[quoted text clipped - 11 lines]
> Does anyone know how I could get the installation path before
> InstallInitialize runs ? Please help. Thanks.
Nick - 10 Aug 2004 17:31 GMT
Thanks Phil for taking your time and answering me.

I understand the part about not using deferred custom actions. I don't
have 1024 as a Type though. The .NET installer created automatically two
rows for my script in CustomAction, Type 51 and 5xx(something like this,
I don't have it here right now).

Now, I have another script, and I set it up with Orca (manually, not
through the .NET installer project) to a CustomAction Type 6(VB Script).
I can put it pretty much wherever I want in the InstallExecuteSequence
table and have it run in the beginning of the installation.

What I wasn't able to figure out was how to read the installation path
:-( I tried MsgBox ("TARGETDIR") and loads of other things which I
thought would return the path. I still couldn't find  the right
parameters/syntax. When I read what you say I imagine it should be
fairly easy. Not for me, at least not yet...

I would really appreciate if you could shed a little bit more light on
this one. Thanks a lot
Phil Wilson - 11 Aug 2004 01:10 GMT
In a VBScript you need to say Msgbox (Property("TARGETDIR"))
Signature

Phil Wilson [MVP Windows Installer]
----

> Thanks Phil for taking your time and answering me.
>
[quoted text clipped - 16 lines]
> I would really appreciate if you could shed a little bit more light on
> this one. Thanks a lot
aro - 11 Aug 2004 08:57 GMT
Thanks Phil.

> In a VBScript you need to say Msgbox (Property("TARGETDIR"))
aro - 10 Aug 2004 17:33 GMT
Thanks Phil for taking your time and answering me.

I understand the part about not using deferred custom actions. I don't
have 1024 as a Type though. The .NET installer created automatically two
rows for my script in CustomAction, Type 51 and 5xx(something like this,
I don't have it here right now).

Now, I have another script, and I set it up with Orca (manually, not
through the .NET installer project) to a CustomAction Type 6(VB Script).
I can put it pretty much wherever I want in the InstallExecuteSequence
table and have it run in the beginning of the installation.

What I wasn't able to figure out was how to read the installation path
:-( I tried MsgBox ("TARGETDIR") and loads of other things which I
thought would return the path. I still couldn't find  the right
parameters/syntax. When I read what you say I imagine it should be
fairly easy. Not for me, at least not yet...

I would really appreciate if you could shed a little bit more light on
this one. Thanks a lot
Ross Stanek - 04 May 2005 18:49 GMT
I am trying just to get the path that the user enters or the default path in my install MSI and pass it to a script that then moves a file from that path to another path.  I want to use a VB Script but I do not know what to pass in the custom action or how to access it in using a VB Script.  I am a technical writer using Visual Studio to create a Help Project so I do not know some of the ins and out of custom actions and VB script.  Any help would be appreciated.

Thanks,

Ross Stanek

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.