Archive: Updating and Overwriting OCX


Updating and Overwriting OCX
I have a few questions that I couldn not find or understand in the documentation was wondering if i could ask here.

I am wanting to overwrite some OCX if newer, currently when the installer runs and it tries to install when the OCX is already there, it throws up a message box to Retry, Ignore, or Cancel.


So i use

SetOverwrite ifnewer


fine

Does this only have to be done before File command once? or in each Section where File command is used?

and I only want to install install the OCX if it doesn't exist or if its newer.

so tyring to understand examples I saw

IfFileExists "$INSTDIR\NSIS.exe" 0 +3


What's the 0 and what's the +3?

Also , should I unregister an OCX if I am updating it then re-register it after its updated or overwritten?

The 0 means that the script continues on the next line and +3 means the script will continue from the third line from this point, skipping 2 line. You could also replace these numbers with labels so the script is more resistant to modification. i.e. if you add extra lines you would not need to change the amount of line to skip.

Vytautas


Tried to delete this post but couldn't so I changed it.


look in the docs at "appedinx B : Useful functions". you will find "Add a shared DLL", "Remove a shared DLL" and "Upgrade a DLL". i use them. they work very good.


Ok
Great I'll check that out. I am just overwriting with "ifnewer" and I no longer get the "cancel/abort/ignore" message.

I guess I dont need to re-register an OCX when overwriting. I am unregistering it on uninstall though.

One strange thing I notice is that when I have Regdll in a section named "" it doesn't HIDE the process.

Not sure what "" for a section name hides exactly. ?


I recommend you to use UpgradeDLL. If you just overwrite a shared OCX it might break other applications in the future.


ok
This happens to be an OCX that is exclusive to my program that I am distributing, but I will check out UpgradeDLL aslo

thanks.


whats with this forum???
This was supposed to be a reply to another message but got diverted when i logged in.

Can't even delete it.


If it's exclusive for your application and the OCX is distributed with the application, there is no need to use UpgradeDLL.