I'm using Inno Setup 6.0.5 and I register two shell extension DLLs which are similar to the ones from ownCloud. One DLL registers a dynamic context menu, another DLL adds overlay icons.
I'm using the facilities Inno Setup provides to do this step. That means:
[Setup]
ChangesAssociations=true
ChangesEnvironment=true
[Files]
...
Source: "shell-integration\*"; DestDir: "{app}\shell-integration"; Flags: regserver 64bit; Check: IsAdminInstallMode;
What I observe is the following:
- After the setup finished, the overlay icons are not active. They only are once I force-restart explorer.exe manually. There are sources like this which claim that this is possible by calling
SHChangeNotify
andSendMessageTimeoutW
, but they are obviously wrong, since I am doing exactly that (seeChangesAssociations
andChangesEnvironment
which are supposed to do this). - After uninstalling, the app directory is not deleted, because the 2 DLLs files are still locked. This also inhibits updating my application. Inno Setup is supposed to detect locked files and offer to close the apps that lock them, but that mechanism doesn't seem to work... Also,
uninsrestartdelete
flag is of no use, as this causes Inno Setup to delete the files only after a reboot, but I don't want to force the user to restart the machine in case they upgrade the application.
What am I supposed to do? The only solution I see is to do everything myself, and not rely on [Files]
and regserver
flag. Especially the uninstallation requires to first unregister the DLL, then force-restart explorer.exe, then actually delete the files and folders. I would do this in CurUninstallStepChanged
in the if CurUninstallStep = usUninstall
block. And to restart explorer.exe I would modify CurStepChanged
in the if (CurStep = ssDone)
block.