Replacing old version of file on uninstall
I have recently repackaged GroupWise 6.5 which has Windows Messaging 4.0 as a dependancy.
The problem is that Windows Messaging overwrites C:\Windows\System32\Mapi32.dll with an older version (one from 1996 to be exact). The dll is required in order for GroupWise to work.
I wish to replace this dll with the one it overwrites if the msi is uninstalled. The best way I can figure to do this is to import the dll into the binary table and use a conditionalised (REMOVE=ALL) custom action to copy it to the system32 folder on uninstall.
The problem is I have no idea how to reference the binary table from within the custom action which I plan to write in VBScript. I could just install the file to the PC and run a custom action to copy it to System32 on uninstall but I think calling it from with in the msi would be better.
Ok thanks for reading...Nik
The problem is that Windows Messaging overwrites C:\Windows\System32\Mapi32.dll with an older version (one from 1996 to be exact). The dll is required in order for GroupWise to work.
I wish to replace this dll with the one it overwrites if the msi is uninstalled. The best way I can figure to do this is to import the dll into the binary table and use a conditionalised (REMOVE=ALL) custom action to copy it to the system32 folder on uninstall.
The problem is I have no idea how to reference the binary table from within the custom action which I plan to write in VBScript. I could just install the file to the PC and run a custom action to copy it to System32 on uninstall but I think calling it from with in the msi would be better.
Ok thanks for reading...Nik
0 Comments
[ + ] Show comments
Answers (11)
Please log in to answer
Posted by:
WiseUser
19 years ago
Posted by:
wiseapp
19 years ago
Hi Nik:
In case you want to replace the old dll the that overwrites your new dll, just add the old dll in your package and goto its option or file details rather and mark self - registration option and select unordered (use normal windows installer behaviour) this would register the dll as well replace the one that exists on the system. In case the mapi32.dll that exists on the system is registered then you need to unregister it before you can copy this dll and get it register . You can do this by running this command regsvr32 /u "c:\windows\mapi32.dll"(leave the quotes as it is ). I think this should serve the purpose.
In case you want to replace the old dll the that overwrites your new dll, just add the old dll in your package and goto its option or file details rather and mark self - registration option and select unordered (use normal windows installer behaviour) this would register the dll as well replace the one that exists on the system. In case the mapi32.dll that exists on the system is registered then you need to unregister it before you can copy this dll and get it register . You can do this by running this command regsvr32 /u "c:\windows\mapi32.dll"(leave the quotes as it is ). I think this should serve the purpose.
Posted by:
MSIPackager
19 years ago
I'm not sure you can copy a file out of the binary table to the destination computer.. If not and you can't get this working by isolating the old dll (which I guess depends on whether or not it needs to be registered) how about having 2 custom actions written in either Wise or VBScript?
The 1st only processed only on install that makes a backup copy of the original .dll in system32 before the new file is copied over.
The 2nd only processed only on uninstall which renames the backup copy (and re-registers it if required) once the updated mapi32.dll file has been removed.
Bit flakey I guess but not sure you have too many options. As long as you test your head off you should be good. Sounds like a good one for Keefey [:D]
Cheers,
Rob.
The 1st only processed only on install that makes a backup copy of the original .dll in system32 before the new file is copied over.
The 2nd only processed only on uninstall which renames the backup copy (and re-registers it if required) once the updated mapi32.dll file has been removed.
Bit flakey I guess but not sure you have too many options. As long as you test your head off you should be good. Sounds like a good one for Keefey [:D]
Cheers,
Rob.
Posted by:
wiseapp
19 years ago
Posted by:
The_Repacker
19 years ago
Hi Bhupesh,
This is problem solved? However
From your Thread can I summerize that YOUR app is not working without OVERWRITING the existing mapi32.dll file? I.e Your App is not working with the newer version of mapi32.dll (OR) Your app works ONLY with the older version which has come with the Vendor of you app.
Please clarify.
Thanks
This is problem solved? However
From your Thread can I summerize that YOUR app is not working without OVERWRITING the existing mapi32.dll file? I.e Your App is not working with the newer version of mapi32.dll (OR) Your app works ONLY with the older version which has come with the Vendor of you app.
Please clarify.
Thanks
Posted by:
wiseapp
19 years ago
Posted by:
Nikolas
19 years ago
Hi guys,
Thanks for the replies. I am sure I can call a file from the binary table in a custom action using VBScript. I just don't know the syntax, have ordered a couple of VB books from Amazon but they take months to delivery them downunder.
So for now it will go in the too hard basket...
Thanks again..Nik
Thanks for the replies. I am sure I can call a file from the binary table in a custom action using VBScript. I just don't know the syntax, have ordered a couple of VB books from Amazon but they take months to delivery them downunder.
So for now it will go in the too hard basket...
Thanks again..Nik
Posted by:
WiseUser
19 years ago
Posted by:
wiseapp
19 years ago
Hi Nik:
I think I posted a reply that clearly do not ask for calling vbscript, just add the dll to your project and self register it(see post above) however for unregistering the old dll you need to run a command (see post above) that you could probably program in Wise script editor itself. So it won't be a hard basket for you any more.[;)]
I think I posted a reply that clearly do not ask for calling vbscript, just add the dll to your project and self register it(see post above) however for unregistering the old dll you need to run a command (see post above) that you could probably program in Wise script editor itself. So it won't be a hard basket for you any more.[;)]
Posted by:
Nikolas
19 years ago
Thanks for the replies,
WiseUser said
I can't see another tidier way to install a different version of an existing file only on uninstallation of the package. Please let me know what you think would be a cleaner option.
wiseapp I am able to overwrite the existing file no problem. Its the replacing it with the overwritten version on uninstall I am having trouble with.
OK happy packaging and thanks again for the posts...Nik[:-]
WiseUser said
You CAN export a file from the binary table to a temporary location and then copy it wherever you like. I even posted a similar script here recently.
But don't you think that's a bit untidy??
I can't see another tidier way to install a different version of an existing file only on uninstallation of the package. Please let me know what you think would be a cleaner option.
wiseapp I am able to overwrite the existing file no problem. Its the replacing it with the overwritten version on uninstall I am having trouble with.
OK happy packaging and thanks again for the posts...Nik[:-]
Posted by:
wiseapp
19 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.