This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problem with major upgrade where dynamic folders have been changed to components
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 10, 2013
10:30 AM
Problem with major upgrade where dynamic folders have been changed to components
We've recently removed a component which installed files from a dynamic folder to install each file as an individual component. We've set it to a major upgrade so that it completely uninstalls the old product and reinstalls the new, but we're finding that when the new components are reinstalled all the file have a ref count of 2, as if something has "remembered" the old files and assumes they were already installed. This obviously isn't a problem until the user uninstalls, at which point all these files are left behind. Manually uninstalling the old and then installing the new operates correctly.
Has anyone else come across this problem, and if so is there a solution please?
Has anyone else come across this problem, and if so is there a solution please?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 11, 2013
08:32 AM
Hi,
The ref counts are there because you have selected yes for "Shared" option on your component. I dont know why is this option yes by default since we dont need to share most files. So if you dont need the ref count, just set it to No. You can also try to uninstall your program, remove refcount from registry(just search for filename in registry) and try it with clear registry.
Hope it helps
The ref counts are there because you have selected yes for "Shared" option on your component. I dont know why is this option yes by default since we dont need to share most files. So if you dont need the ref count, just set it to No. You can also try to uninstall your program, remove refcount from registry(just search for filename in registry) and try it with clear registry.
Hope it helps
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 11, 2013
08:58 AM
Thanks for the reply 🙂
We do need the ref counts because these are shared components, and on a clean install they work fine (i.e. 1). However, we have had issues in the past with major upgrades because for some inexplicable reason Windows Installer evaluates what needs doing to components *before* it uninstalls the old products so we've sometimes had odd components not reinstalled after the upgrade etc. Thus it appears this evaluation was causing the dynamic files to be reinstalled and the new files on top of that, causing a ref count of 2.
The solution I have found (for anyone else who may have this problem) is this; it's not very elegant, and it's still a little unclear to me as to why it actually works:
After the SetupProgress custom action in Installation/User Interface, I have an InstallScript custom action which simply calls:
MsiSetFeatureState(hMSI, "", INSTALLSTATE_ABSENT);
Then just before the ProcessComponents custom action in Installation/Execute (and after RemoveExistingProducts) I call another InstallScript action which does:
MsiSetFeatureState(hMSI, "
This appears to fool Windows Installer into not pre-evaluating the components within this feature, and they are installed correctly with ref counts of 1.
We do need the ref counts because these are shared components, and on a clean install they work fine (i.e. 1). However, we have had issues in the past with major upgrades because for some inexplicable reason Windows Installer evaluates what needs doing to components *before* it uninstalls the old products so we've sometimes had odd components not reinstalled after the upgrade etc. Thus it appears this evaluation was causing the dynamic files to be reinstalled and the new files on top of that, causing a ref count of 2.
The solution I have found (for anyone else who may have this problem) is this; it's not very elegant, and it's still a little unclear to me as to why it actually works:
After the SetupProgress custom action in Installation/User Interface, I have an InstallScript custom action which simply calls:
MsiSetFeatureState(hMSI, "
Then just before the ProcessComponents custom action in Installation/Execute (and after RemoveExistingProducts) I call another InstallScript action which does:
MsiSetFeatureState(hMSI, "
This appears to fool Windows Installer into not pre-evaluating the components within this feature, and they are installed correctly with ref counts of 1.