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!

JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Installer best practice?

I have a service that needs some info specified by the user upon install. So let say I need to get several user folders specified from the current user and that data will be stored in a local config file that has other settings in it was well.

Is is best to install the service and then use Custom actions to change the config file or create a temp folder with the config files and modify them and copy them to there location before installing the service.

Note the service will be set to start automatically.

I am not sure what the best practice is for this type of functionality, I guess this is similar to getting user credentials or a license. Is there a good example for .net anywhere for this?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installer best practice?

Hi and welcome to our forums,

There is no need for a custom action, you can use our built-in support to update files. If your config file is in XML format, you can import the XML and update it at install time.

If your file has a non-standard format, then you can treat as a text file and use our Text Updates support. This works the same way as the XML editor, but it has no support for import, so you practically have to copy paste the content of the file in our editor, then update the references where the user folders should be resolved with the corresponding properties.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JustAProgrammer
Posts: 26
Joined: Mon Apr 07, 2014 10:11 pm

Re: Installer best practice?

Sorry for not being clear or giving enough insight into what I am trying to do. The program is running as a service and will need to connect with a web service to get user specific data that is then written to the local config file as well as upload some of the decisions made based on options presented to the user. Is there a good way to do this built into advanced installer without using a custom action? What is considered the best route for doing this?

Currently I am installing the service, if that all goes well then I am connecting to the web service using credential info acquired from an installer dialog and pulling in the data I need. I am then presenting dialogs based on that data to display options to the user and using a custom action to save there selections to a local config files and upload them back to the web service. The service is looking for the info in the local config and that it uses it to connect to the web service.

I have seen others that use custom actions to get data and store it in a temp folder and then copying the files from temp storage to where they should be either during the install of the service or before. Is this a better way? Either way I feel it involves using custom actions that use some dlls that will be called to get the functionality desired as there is some checking going on as well as upload of local settings.

Also since the custom action is using some of the dlls the service is using would it be better to install the service and then use a custom action that uses IPC to communicate with the service to activate it and eliminate having to have those dlls in the custom action? I know this goes into design, but I am trying to eliminate desktop interactions which were currently used to get user info and do the checking and data exchange. I am just trying to figure out the best way to do this with an installer service as I want to eliminate the desktop interactivity.

Thanks in advance for the any help or guidance.

edited to correct the current sequence.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Installer best practice?

Hello,

I'm afraid we don't have built-in support for your scenario. As you already mentioned you can develop and use your own custom action which will fetch and then upload data on your server. Also, if the custom action needs to edit installed config files, then you should add it as a deferred custom action with sequence scheduled after "Install Execution Stage -> Add Resources" actions group.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”