Custom action after files installed, but before services sta - Advanced Installer Community

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!

janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

Custom action after files installed, but before services sta

Hi,

I would like to create a custom action (dll) and having a few little issues.
Firstly, I would like it to be called before the services start, but after all the files have been installed. Reason : configuration files need to be updated so the service has the correct configuration files.

Secondly, when I use the following line :

UINT res = ::MsiGetProperty(hInstall, L"APPDIR", wszValue, &dwLen);

I get an result of 234, What does this actually mean. I have tried it in the Install Sequence locations (Begin, CostFinalize, ProgressDlg, and ExecuteAction) and InstallExecuteSequence(Install, and Commit).

What could i be possibly doing wrong ?

Yours sincerely
Jason
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
I would like it to be called before the services start, but after all the files have been installed.
This can be done by scheduling the custom action after the "InstallFiles" standard action and before the "StartServices" standard action in the "Custom Actions" page.

You can see these standard actions (they are in the "Before Finalization" menu) by using the "Show Standard Action" button on the toolbar.
Secondly, when I use the following line :
UINT res = ::MsiGetProperty(hInstall, L"APPDIR", wszValue, &dwLen);
I get an result of 234, What does this actually mean.
This error means that the buffer you are using is not large enough. You can see this error on this page:
http://msdn2.microsoft.com/en-us/library/ms681382.aspx

In order to find out what a system error means you can use a tool distributed with Visual Studio: Error Lookup.

There is an example for what you need here:
http://msdn2.microsoft.com/en-us/library/aa370134.aspx

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

Sorry, I should have read my source more carefully, I was doing a wcslen instead of a sizeof of the aginst the supplied buffer( silly me :-) ) Sorry for the stupid question.

However now I get a blank result for APPDIR, INSTALLDIR so I am either asking for the wrong variables or I dont know. Where do I get the list of variables I can query for? Is there something I have to instruct the AdvancedInstaller to export variables ?

The solution to the other problem works a treat, now if I can only work out the above issue, I think I might be done, and we will definately purchase the product.

Cheers
Jason

Return to “Common Problems”