alan93
8th November 2003 23:10 UTC
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?
Vytautas
8th November 2003 23:22 UTC
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
alan93
8th November 2003 23:42 UTC
Tried to delete this post but couldn't so I changed it.
o_owd
9th November 2003 08:59 UTC
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.
alan93
10th November 2003 13:48 UTC
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. ?
Joost Verburg
10th November 2003 15:34 UTC
I recommend you to use UpgradeDLL. If you just overwrite a shared OCX it might break other applications in the future.
alan93
10th November 2003 16:24 UTC
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.
alan93
10th November 2003 16:29 UTC
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.
Joost Verburg
10th November 2003 17:04 UTC
If it's exclusive for your application and the OCX is distributed with the application, there is no need to use UpgradeDLL.