tags:

views:

7

answers:

1

My setupper gives the ERROR access denied dialog when overwriting one DLL fails, its locked&in use sometimes.

what is recommended procedure for doing this..

Can I somehow make INNO to compare if its even necessary to overwrite this DLL (size match?)

+1  A: 

InnoSetup automatically compares the files to see if it needs to be replaced by looking at the version resource in the file.

You should add the RestartReplace flag to the [Files] entry for your DLL (and any other file that might be in memory / locked). From the InnoSetup documentation:

restartreplace

When an existing file needs to be replaced, and it is in use (locked) by another running process, Setup will by default display an error message. This flag tells Setup to instead register the file to be replaced the next time the system is restarted (by calling MoveFileEx or by creating an entry in WININIT.INI). When this happens, the user will be prompted to restart their computer at the end of the installation process.

To maintain compatibility with Windows 95/98/Me, long filenames should not be used on entries with this flag. Only "8.3" filenames are supported. (Windows NT platforms do not have this limitation.)

NOTE: This flag has no effect on Windows NT platforms if the user does not have administrative privileges. Therefore, when using this flag, it is recommended that you leave the PrivilegesRequired [Setup] section directive at the default setting of admin.

mirtheil
it seems inno cannot compare when DLL is in use?
Tom
Actually, I think it compares the file before attempting to replace it. When it attempts to replace it and finds it locked, the error is returned. Make sure your DLL has a version resource in it and the new version has a higher version than the old one.
mirtheil