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

How to refer to SUPPORTDIR in Custom Actions


4 replies to this topic

Kenerry

Kenerry
  • Members
  • 6 posts

Posted 10 June 2004 - 02:26

Hi.

I am now working with Developer 7, trying to execute in custom actions some EXEs stored in SUPPORTDIR . But they fail to run properly. The following are my steps:

1. Add "app1.exe" into SetupFiles/Billboards->Language Independent section.
2. Create a new custom action named "app1" manually(not with the wizard). Type in "SUPPORTDIR" as the source, "app1.exe" as the target.
3. Add the "app1" action into Sequences->Installation->Execute, after "InstallFiles".
4. Build the release. Everything is ok.

But when the setup runs into the position where the action takes place, I receive two errors. The first is "Internal error 2721. NewCustomAction1". The second is "Error: -1603 Fatal error during installation. Consult Windows Installer Help(Msi.chm) or MSDN for more information." I checked the -1603 error in the help but can't solve it.

Then I re-configure the "app1" action with the Custom Action Wizard. If I choose the location as "Installed with the product" and browze for the file "app1.exe", it is in the Component list but can't be added into the Files list. If I choose "Stored in the Directory table" and type "SUPPORTDIR" and "app1.exe" as source and target, the same error messages as above occur. No matter I change the execution mode as "Immediate execution" or "Deffered execution", or set the sequence of the action after "InstallFiles" or after "InstallFinalize" (under the direction of help), the problem still exists. Also I have tried to make a new component in the component view, put "app1.exe" into it, and selelct the component and the file by locating "Installed with the product". This passes the wizard dialog but still fail to avoid the error message.

My only solution is to add the EXEs into INSTALLDIR and locate "Installed with the product". Then the EXEs can be selected and ran properly in setup. -- But then I find that if I try to uninstall the product, the -1603 problem occurs again and the uninstallation is not completed correctly!

I am really confused about the usage of SUPPORTDIR in custom actions and any help is appreciated.

Edited by Kenerry, 10 June 2004 - 02:33.


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 10 June 2004 - 03:46

First of all I assume the custom action is of the appropriate launch executable type. I am sure I have done this, but I used the LaunchApp and LaunchAppAndWait features in Installscript custom actions. Something like this:

LaunchAppAndWait(SUPPORTDIR ^ TheExe.EXE);

The ^ character in the command line will ensure that the correct number of \ characters are inserted in the command line. I also remember having to surround long path names with " characters. I can dig up this code if need be.

I would guess that the call fails either because there is a missing \ in the path or because there is a space in the path name:

C:\programfilesTheExe.exe

or

C:\ Program Files\TheExe.exe instead of "C:\ Program Files\TheExe.exe".

Edited by Glytzhkof, 10 June 2004 - 03:48.

Regards
-Stein Åsmul

Kenerry

Kenerry
  • Members
  • 6 posts

Posted 11 June 2004 - 08:40

Thank you. I use LaunchAppAndWait() with SUPPORTDIR and it works. But the uninstallation problem remains the same. It seems that SUPPORTDIR only works in script and the project environment unable to recognize it?? But the following article shows that SUPPORTDIR should be applicable while it's "not included in your Directory table".

http://support.insta...ticleid=Q105571

But if I type SUPPORTDIR for the source in custom action wizard, it wil be added into the directory table automatically.

Then the two other problems:

1. The uninstallation error(as mentioned above). I trace the unintall process with setup.exe /Verbose"c:\mysetup.log". The 1721 error is logged when the problem occurs:

MSI (s) (4C:78): Executing op: ActionStart(Name=app1,,)
Operation 11:22:27: app1.
MSI (s) (4C:78): Executing op: CustomActionSchedule(Action=app1,ActionType=1042,Source=D:\Program Files\Your Company Name\Your Product Name\app1.exe,,)
MSI (s) (4C:78): Note: 1: 1721 2: app1 3: D:\Program Files\Your Company Name\Your Product Name\app1.exe 4:
MSI (s) (4C:78): Note: 1: 1721 2: app1 3: D:\Program Files\Your Company Name\Your Product Name\app1.exe 4: Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: app1, location: D:\Program Files\Your Company Name\Your Product Name\app1.exe, command:

2. If I make a setup file under win2k system with sp4 and run it under another system with sp3, it fails with error 1603. If vice verse, it succeeds. Seems that the APIs of Windows Installer differ between sp versions. How can I find out the differences?

Edited by Kenerry, 11 June 2004 - 08:55.


Kenerry

Kenerry
  • Members
  • 6 posts

Posted 11 June 2004 - 10:44

Well, now I have given up each way about the custom action, and use pure script to launch and delete the EXEs. Now the errors no longer exist either during installation or uninstallation.

Kenerry

Kenerry
  • Members
  • 6 posts

Posted 15 June 2004 - 03:46

All these sum up to two questions: The SUPPORTDIR is not recognized by the IS environment except the script engine; any kind of custom action leads to 1603 error, either during installation or uninstallation, or both.