On 9/30/2024 1:10 PM, 'Bill Stewart' via innosetup wrote:
> It's a good question; I don't know the answer, unfortunately.
>
> It seems that RM just does not work reliably for Explorer context menu
> extensions. This would seem to be another example:
>
>
http://www.classicshell.net/forum/viewtopic.php?p=6131
In that case, do you see anything wrong with my planned workaround?
All Users install relies on the existing
restartreplace/uninsrestartdelete behavior.
Current User install:
1) Have two [Files] entries, one to the original filename and one where
DestName includes a '.pending' suffix
2) Add a Pascal scripting function that toggles between the two based on
whether the file exists, has a different version number than the
incoming one (GetPackedVersion/SamePackedVersion), and can be opened for
writing (via CreateFile(GENERIC_WRITE))
3) Set up a Windows HKCU [Run] registry entry to run one of our apps
with a custom flag when the user logs in. If the flag is detected, use
MoveFile to try to replace the files with the .pending versions. If
that succeeds, remove the [Run] entry.
For (2), it seems like this would be better handled via some sort of
PasScript callback from
PerformInstall.ProcessFileEntry.DoHandleFailedDeleteOrMoveFileTry?
For (3), I'd prefer to use [RunOnce] instead, but if the user logs in
and right clicks before our helper launches, it needs to try again the
next time. I could disable the extension after the install until the
replace succeeds, but the extension is written expecting it might be out
of date relative to the rest of the app, and I'm trying to avoid being
too disruptive if users are in the middle of something.
If there's a better way to approach any of this, I'd love to hear it.
Thanks again,
Zoë Peterson
Scooter Software