Shared dll (RefCount)
Hi,
Been a while since my last posting, and as always your help is appreciated.
I have been given an .msi that I am trying to tailor with a transform, but I have a problem with it's uninstall that i'm hoping for some help with.
If I install my app, and then uninstall it, everything is removed correctly, and the app behaves as it should.
If I install an older version of my app, then install my new version, it upgrades the old version to the new one. If I then uninstall my new version, it leaves 1 dll file behind in the INSTALLDIR.
After a bit more digging I have found that it is related to the Shareddll reference count. When the app is upgraded the count on this .dll is increased to 2, hence on the uninstall it still has a reference count of 1 and is not uninstalled. During A standard install the ref count is just 1 so the file is uninstalled as expected.
Is there a way to tell my app that it does not need to increase this count on an upgrade? I am using Wise Packaging Studio, and there is a tickbox for 'Always increment shared .DLL count' that is ticked, but if I untick this box will the dll stop reference counting all together?
Thanks in Advance,
Gary.
Been a while since my last posting, and as always your help is appreciated.
I have been given an .msi that I am trying to tailor with a transform, but I have a problem with it's uninstall that i'm hoping for some help with.
If I install my app, and then uninstall it, everything is removed correctly, and the app behaves as it should.
If I install an older version of my app, then install my new version, it upgrades the old version to the new one. If I then uninstall my new version, it leaves 1 dll file behind in the INSTALLDIR.
After a bit more digging I have found that it is related to the Shareddll reference count. When the app is upgraded the count on this .dll is increased to 2, hence on the uninstall it still has a reference count of 1 and is not uninstalled. During A standard install the ref count is just 1 so the file is uninstalled as expected.
Is there a way to tell my app that it does not need to increase this count on an upgrade? I am using Wise Packaging Studio, and there is a tickbox for 'Always increment shared .DLL count' that is ticked, but if I untick this box will the dll stop reference counting all together?
Thanks in Advance,
Gary.
0 Comments
[ + ] Show comments
Answers (14)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
beefy66
14 years ago
Thanks Mekaywe,
I have just checked the GUIDS for this component and they are the same in both versions. The content of the components is different though, The old version has a component error(it has no keypath)with a single file in it, where as the newever version has this same file and a removefile item, and it has the filke as a keypath. I dont know whether this would effect it's behaviour?
I have just checked the GUIDS for this component and they are the same in both versions. The content of the components is different though, The old version has a component error(it has no keypath)with a single file in it, where as the newever version has this same file and a removefile item, and it has the filke as a keypath. I dont know whether this would effect it's behaviour?
Posted by:
cygan
14 years ago
Posted by:
shweta_kar
14 years ago
Hi,
Create a VBS file say 'CleanUp.vbs' & add below script to it . & make this file as permanent.
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile = fso.OpenTextFile("C:\Program Files\CleanUp.vbs", ForWriting, True)
oFile.WriteLine "on error resume next"
oFile.WriteLine "CreateObject(""WScript.Shell"").Regdelete ""HKCU\Software\Microsoft\Office\11.0\Excel\Options\Open"""
Note: In my case addin was not getting removed due to the entry HKCU\Software\Microsoft\Office\11.0\Excel\Options\Open,hence it has been deleted.
Also the cleanUp.vbs is kept directly under program files, it just an e.g. I suggest that keep the file under program files\app name folder.
Script to be used in CUSTOM ACTION
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\<appname>\StubPath", "cscript.exe ""C:\Program Files\CleanUp.vbs""", "REG_SZ"
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\<appname>\Version", "1,0,0,0", "REG_SZ"
Create a VBS file say 'CleanUp.vbs' & add below script to it . & make this file as permanent.
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile = fso.OpenTextFile("C:\Program Files\CleanUp.vbs", ForWriting, True)
oFile.WriteLine "on error resume next"
oFile.WriteLine "CreateObject(""WScript.Shell"").Regdelete ""HKCU\Software\Microsoft\Office\11.0\Excel\Options\Open"""
Note: In my case addin was not getting removed due to the entry HKCU\Software\Microsoft\Office\11.0\Excel\Options\Open,hence it has been deleted.
Also the cleanUp.vbs is kept directly under program files, it just an e.g. I suggest that keep the file under program files\app name folder.
Script to be used in CUSTOM ACTION
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\<appname>\StubPath", "cscript.exe ""C:\Program Files\CleanUp.vbs""", "REG_SZ"
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\<appname>\Version", "1,0,0,0", "REG_SZ"
Posted by:
anonymous_9363
14 years ago
Once again, I'm afraid, we have here a display of ignorance about how XL add-ins are set up in the registry.
Your code works fine PROVIDED that the add-in recorded in the 'OPEN' value is the only add-in present. If it's not, your code will remove some other add-in. This is not a way to endear yourself to your users: they get a bit annoyed by things like that.
Search AppDeploy for 'add-in' and read the myriad of posts on the subject.
Then, take a look at the posts in this thread: how does your response marry up in any way to any of them? :)
Your code works fine PROVIDED that the add-in recorded in the 'OPEN' value is the only add-in present. If it's not, your code will remove some other add-in. This is not a way to endear yourself to your users: they get a bit annoyed by things like that.
Search AppDeploy for 'add-in' and read the myriad of posts on the subject.
Then, take a look at the posts in this thread: how does your response marry up in any way to any of them? :)
Posted by:
beefy66
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
anonymous_9363
14 years ago
I'm sorry but why would you think removing the key path would help?
@OP, the '8' means that the file will be reference-counted. See here for details.
@OP, the '8' means that the file will be reference-counted. See here for details.
Posted by:
beefy66
14 years ago
***Update***
I tried removing the removefiles entry from the component and this has made no difference, however when I removed the keypath so that the component was broken, it worked. The component now has exaclty the same content in bothe the old and new version (except of courase, the .dll is a newer version and file size in the newer install).
I tried removing the removefiles entry from the component and this has made no difference, however when I removed the keypath so that the component was broken, it worked. The component now has exaclty the same content in bothe the old and new version (except of courase, the .dll is a newer version and file size in the newer install).
Posted by:
anonymous_9363
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.