patch destroys registry key with SourceDir property - 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!

Borek
Posts: 10
Joined: Wed May 21, 2008 3:59 pm

patch destroys registry key with SourceDir property

OK, so I was finally able to create a patch, but new problem arises. My program checks for the presence of CD, for that installer puts [SourceDir] into registry key, so that program can check it later. It works - installator puts something like F:\MSI\ into registry and thats OK with me. However, when I use the patch registry key is erased - it still exists, but it contains now empty string.

Could be it all works OK accidentally, as I am using exe bootstrap but not [SETUPEXEDIR] property? But if that's the case I would expect problems earlier, not when applying patch.
F
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: patch destroys registry key with SourceDir property

Hi,

When a patch is applied, Windows Installer triggers a repair for the old installation. If your custom registry entry is repaired, it will replaced with an empty value (the "SourceDir" property is not available during a repair). The solution for this situation is to use the "Never Overwrite" attribute for the component of the registry entry (in the Component Properties page). This way, the registry entry will not be overwritten during a repair (triggered by the patch).
Could be it all works OK accidentally, as I am using exe bootstrap but not [SETUPEXEDIR] property?
Usually, the SourceDir property is set only if you run the MSI package directly (not through a bootstrapper). If you are using an EXE bootstrapper for the package, it is recommended to use the SETUPEXEDIR property. I'm not sure if this is one of the causes of your problem, but please try using SETUPEXEDIR instead of SourceDir.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Borek
Posts: 10
Joined: Wed May 21, 2008 3:59 pm

Re: patch destroys registry key with SourceDir property

I have switched to SETUPEXEDIR - nothing have changed - I mean it worked OK before and it works OK now, I will stick with SETUPEXEDIR as you suggest it is more correct.

However, for some reason msi built without Never Ovewrite works OK, but built with Never Overwrite displays message "Can't open key UNKNOWN\Software\BPP\Sposób na dysleksję blah blah blah" (or something similar, my UI is in Polish) and stops to work. Looks like this UNKNOWN part is the source of the problem.
F
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: patch destroys registry key with SourceDir property

Hi,

This behavior may be encountered because of a Windows Installer bug or a problem with the target machine (we cannot reproduce it). Please note that you can try another approach: backup and restore the registry entry. For this, you can use custom actions in the upgraded package which backup and restore the registry entry that contains SETUPEXEDIR.

The custom action which performs the backup can be scheduled under "InstallExecuteSequence" -> "Begin" and the one which restores the entry can be scheduled under "InstallExecuteSequence" -> "InstallFinalize". You can find sample custom actions here:
http://www.advancedinstaller.com/forums ... f=2&t=4853

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”