Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Launch An .EXE From Directory Table


6 replies to this topic

MIchael Scribano

MIchael Scribano
  • Members
  • 15 posts

Posted 26 April 2001 - 01:36

From a custom action, I'm trying to call an .exe file from the source media
to launch a separate installation provided the conditions are met.  Rather
than copy all the files included with this installation (52 MB) to the
target before launching it (if the condition is even TRUE in the first
place), it would more efficient just to run it from the installation CD, if
needed.

I suspect there's something wrong with the entries in the Directory table.
I've been working at it for awhile, but I can't get it to run.  I typically
get "Internal Error 2743", which I presume indicates that MSI couldn't find
the .exe file.

Any ideas?


Joe Fegan

Joe Fegan
  • Members
  • 38 posts

Posted 26 April 2001 - 15:34

I haven't tried this myself but I would imagine you would use a custom action of type 34 and use the value of the SourceDir property in some way to find another file on the same source disk. Maybe something like this:

Action: caRunOtherExe
Type: 34
Source: SourceDir
Target: "[SourceDir]MyProg.exe"


MIchael Scribano

MIchael Scribano
  • Members
  • 15 posts

Posted 27 April 2001 - 15:24

Thanks for your help, Joe.  You got me on the right track.

I didn't know that the full path was required in the Target since the path is also in the Source.  The Source field seems to be to CAs what the Working Directory is to shortcuts, or to program items in the Windows 3.x days.


michellegray

michellegray
  • Members
  • 3 posts

Posted 13 June 2001 - 15:34

Hi Michael,

I am doing something similar. I also have to launch an exe to run another installation before my installation installs anything. I have created a custom action with type 2 after making the appropriate entry in the binary table. After that I inserted the action into the ReadyToInstall dialog, but nothing seems to be happening. You maybe have any ideas on what I may be doing wrong?


MIchael Scribano

MIchael Scribano
  • Members
  • 15 posts

Posted 14 June 2001 - 20:30

Hello, Michelle,

The custom action I'm using is Type 354, which is calling an executable residing in another directory on the CD-ROM.  I did not want to make that installation package a part of the MSI database since it was already on the CD.

However, I have tried something similar to what you are doing while I was testing this project.  I had it simply launch Notepad and it worked fine.

You mentioned inserted it into the ReadyToInstall dialog.  I don't know how, or if you can do that.  Have you tried to insert your CA into a sequence, such as at the beginning of the Execute sequence?


gowen

gowen
  • Members
  • 15 posts

Posted 19 June 2001 - 11:31

After many days of struggling to use [SOURCEDIR] as the source for a type 34 (Run from Directory Table) custom action I realised that [SOURCEDIR] is actually a property that is created at run time and should not be confused with the SourceDir entry in the directory table.

So instead of type 34 the custom action should be type 50 - Run from property table.

Example:
Type : 50
Source: SOURCEDIR
Target: mydir\myprog.exe arg1 arg2

SOURCEDIR does not appear in the Property drop down list in the custom action wizard as it is not created until runtime.


gowen

gowen
  • Members
  • 15 posts

Posted 20 June 2001 - 17:04

Sorry, Ignore my last post.  It is correct in that you can't use SOURCEDIR with a type 34 CA, but the example is completely wrong.

Here is a correct solution which I have got running in front of me so I know it works.

1. Create a CA to set a property with the command line to run your program, but without any arguments.

CA Name:SetDocExe
Type: 51
Source: CMD
Target: [SOURCEDIR]Documents\Setup.exe

2. Create a second CA which executes a program stored in a property. The Source will be the same property used above.  If you have any command line arguments, put them in Target; Otherwise leave it blank.

CA Name: ExeCMD
Type: 50
Source: CMD
Target:

3.  Insert the two CA's into your sequence.  For instance on a PushButton create a DoAction for SetDocExe and another for ExeCMD.

4. Compile and run your setup and if all is well your program should be run when you press the button.