We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

helios
Posts: 2
Joined: Mon Apr 02, 2007 10:00 am

Sequence of custom action

Hi,
I have a project that must exec some custom action until finished and
must be executed in Windows Vista and previous version.
The sequence of that action are:

- copy old configuration file in a temp dir before uninstallation of older version;
- stopping and removing old service;
- install new service (after the file copies);
- copy old configuration file from the temp dir;
- start new service;

From the HowTo's I've copied the VB script to execute the copy of file
in order to save it from uninstall and now my project have:

In section InstallValidate: run VB script (immediate execution) with Backup;

In section uninstall: remove old service with no impersonation;

In section Commit: install new service with no impersonation;

In section InstallFinalize: run VB script (immediate execution) with Restore;

The problem is the start of the new service. If I put the start in the Commit section the old configuration file aren't copy. If I put the start in the InstallFinalize section it's fail on Vista because the service starts without the clause "no impersonation". If I move the VB script from InstallFinalize to Commit section the problem is that in order to use property (such as name of the Temp folder) I need run VB script with Immediate Execution and at this time the new file aren't copy (at the moment of copy new configuration file are copy over the saved version).

There are a solution to this problem?
Thanks in advance,
Helios.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Helios,

Deferred custom actions does not have access to all properties. But they can read "CustomActionData" property. You can set the "CustomActionData" property for a custom action in the "Action Data" field.

Here is what you need to do:

Move the custom action that makes the Restore from "InstallFinalize" to "Commit" (move it in front of the start service custom action) and use "Deferred" as "Execution Options". In the "Action Data" field of this custom action type the formatted text you entered for the "Property Set With Formatted" action.

Now in your custom action the path to the file is stored in the "CustomActionData" property. So use this property to access the file.

You can use "Action Data" for the Backup action also but this is not mandatory since this custom action is immediate and can read properties directly.

Let me know how this works.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
helios
Posts: 2
Joined: Mon Apr 02, 2007 10:00 am

Hi gigi,
thanks a lot for the solution! It works very well! :D
Best regards,
Helios.

Return to “Common Problems”