innosetup uninstalling common dll's while their still in use by visual st (Resolved)
I've recently started using Inno Setup to deploy my VB applications and I've noticed a bit of an issue I'm hoping someone can help me with. I'm selecting the option that has Inno Setup create an automatic uninstaller and that seems to work fine in most cases but...
If I then run the set up on a system that has visual studio, then use the un-installation option that got created, it removes any common dll's that were part of the installation (assuming they're referenced by another installation of course). The next time I open visual studio it gives me a series of error messages complaining that the components are missing. I guess that inno setup doesn't recognise that VS itself references those dlls so it thinks they're finished with. Is there anyway I can stop it from removing those components?
Re: innosetup uninstalling common dll's while their still in use by visual studio
When you create the Uninstall, does it permit you to specify what files should be removed?
Re: innosetup uninstalling common dll's while their still in use by visual studio
Hi Hack
No, I'm afraid not. You just tick a checkbox telling it you want an unistall option created. Thing is, I'm using a wizard which ultimately produces a script. Checking the 'create an unistall' option in the wizard puts this line:-
Code:
Name: "{group}\{cm:UninstallProgram,E1 Enhanced Support}"; Filename: "{uninstallexe}"
...into the script. It doesn't look like I'd be able to edit that line in any way to specify which files are uninstalled but I think I might be able to edit the script elsewhere - I just don't know where and can't find it in the helpfile.
Re: innosetup uninstalling common dll's while their still in use by visual studio
FunkyDexter,
You can achieve what you want. If yo mark the dll on install as shared dlls this should not happen. Generally the Inno Setup uninstall will not uninstall common dll's. This is a function of the OS it's self. All uninstalls will attempt to uninstall common dlls unless you specificly tell it not to (which you can BTW).
What happens it that an uninstall of a DLL is requested to OS. The OS will check the registry for the number of times that this DLL was registered and decrement the count. The dll will not be uninstalled until the count reached zero (shared).
However if you did not mark the dll as shared on your install and only one other app installed the dll the count will be 1. Now when you uninstall it the count will be zero and it will be removed. If you had marked the dll as shared the count would have been 2 and on uninstall it would be decremented to 1 and it would not be uninstalled.
So you control this in your installation. Install well... If you had used ********** (not the Inno Setup Wizard) to help create your script I don't believe this would have happened.
Re: innosetup uninstalling common dll's while their still in use by visual studio
Hi Randem
Huzzah, that worked. I'd figured it was probably just a flag but couldn't work out which one. Just to be sure, you're suggesting using the 'sharedfile' flag against the common dll's in the files section, yes? I think that's the one you mean and it certainly seems to be givingme the right behaviour.
I'm totally new to inno setup so I'm still using the Wizard to create my
basic install scripts before I then edit them in **********. I imagine that, as I get a bit more comfortable with it, I'll gradually switch to just using ********** as you suggest.
Thanks
Dec
Re: innosetup uninstalling common dll's while their still in use by visual st (Resolved)
FunkyDexter,
How do you edit them in **********? ********** doesn't allow editing. You must mean Inno Setup. You should just start with ********** and be done with it. It will save you loads of headaches like the one you just had. Check my signature for it.
And yes, the sharedfile flag is what I meant.
Re: innosetup uninstalling common dll's while their still in use by visual st (Resolved)
Yep, sorry, I thought you meant the scripting window of innosetup. I'm at home now so can't try out ********** but from taking a quick peek around that link it looks ideal. Basically does everything for me - I like that :)
Re: innosetup uninstalling common dll's while their still in use by visual st (Resolved)
FunkyDexter,
You wouldn't believe how hard it is to lead people down the path of ease of use. Most try to climb the mountain...