Should I write APPDIR to the registry and if so how? - 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!

BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Should I write APPDIR to the registry and if so how?

Using AI Professional, I built my first installer for my VB application and it seems to work fine. Now that the application is deployed on target machines, I am trying to build an update installer that will replace single (or several) files on the target machines without uninstalling and reinstalling the whole application. For some reason this conceptually simple task seems hard to do with AI, but this may just be my inexperience with the product.

One approach I am considering to make this easier is to write the APPDIR value to the registry in my initial installer. Is this a good idea and if so, what are the steps to write and read the folder location from the registry and use the value retreived in my update installer?

Thanks for any help>
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Should I write APPDIR to the registry and if so how?

As a follow-up to my original question, what additional steps are necessary in an AI installer to:

1. Set string values for the Manufacturer and Product properties.
2. Read the registry key (not sure which one) for [Manufacturer] and [Product] values.
3. Display a message box showing "Application folder = " and the "Path" key value.
4. Use the path key value to copy and replace files contained in the payload of the installer.
5. Display an error messagebox "Product not installed" if the registry key value returned null.

Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Should I write APPDIR to the registry and if so how?

Hello,
I am trying to build an update installer that will replace single (or several) files on the target machines without uninstalling and reinstalling the whole application. For some reason this conceptually simple task seems hard to do with AI, but this may just be my inexperience with the product.
What you're describing would be a patch upgrade behavior. However, authoring patches is a very delicate process and requires careful settings not to mention keeping the patch rules. Here's a thread that clarifies this. Also, please keep in mind authoring patches is available starting with Enterprise edition and project types.
One approach I am considering to make this easier is to write the APPDIR value to the registry in my initial installer. Is this a good idea and if so, what are the steps to write and read the folder location from the registry and use the value retreived in my update installer?
This implies you make that value persistent between versions, however in a patch scenario the old version doesn't get removed and all you would have to do is:
- set ver 1.0 to create the registry value in the Registry page
- set ver 2.0 to add a search which retrieves that value from the Search page

In case of a major upgrade you can follow How do I prevent a file from being uninstalled or repaired? or use the "Persistent User Data" wizard from the Home tab. (FYI: we'll also improve this functionality in our next version)
Set string values for the Manufacturer and Product properties.
Here's "Product Information Properties" article with Windows Installer properties that store the information you need. These properties can be set from the Product Details page.
Read the registry key (not sure which one) for [Manufacturer] and [Product] values.
This can be done from the Search page.
Display a message box showing "Application folder = " and the "Path" key value.
The How do I display a message box? article can help.
Use the path key value to copy and replace files contained in the payload of the installer.
This can be done with Text File Updates.
Display an error messagebox "Product not installed" if the registry key value returned null.
Search names are actually public properties which are set only if the search is successful. You can use the search name as part of the message box condition.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Should I write APPDIR to the registry and if so how?

I read the referenced article "How do I display a message box?" but my messagebox is not displayed by the installer. It may be displayed very briefly, but there is no way to see what is on the screen because it goes by so fast. My messagebox is attached to the search method of the wizards dialog stage but I'm not sure. This is what the action data looks like:

Desktop folder = [DesktopFolder] | Default title | MB_OK , MB_SETFOREGROUND , MB_ICONINFORMATION | BTN_PRESSED | [CLIENTPROCESSID]

What do I need to do to determine exactly when in the package installer sequence the messagebox is displayed?
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Should I write APPDIR to the registry and if so how?

The message box is now displaying OK.

Return to “Common Problems”