简体   繁体   中英

Windows 7 64-bit file and icon association inconsistency (compared to Win7/32, WinXP/32, and WinXP/64)

We are working on an NSIS installer that edits the registry for a couple file types to change their icons and the application that runs them.
Our workflow works correctly on Win7/32-bit, WinXP/32, and WinXP/64, but on Win7/64 it does not work. We've tested this on multiple Win7/64 machines, and the problem is consistent on both Win7/64 instances.
One additional detail is that it's only when overriding an existing association, since creating a new one works fine.

The registry edits simply set DefaultIcon and shell/open/command After the registry edits are complete we use the SHChangeNotify system call to force the shell to update with the new settings.
On Win7/64, the filetype that is already in the registry is not updating to the new values.

; Tell the shell to reset its icon cache
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(0x08000000, 0, 0, 0)'

Any help is greatly appreciated, especially solutions that don't involve a system restart or restarting Explorer. Thank you for any/all help! -Chris

This issue could be related to any number of things than tend to go wrong with the registry on x64: Virtualization , Redirector and Reflection . It could also be possible that you are incorrectly mapping from file extension to progid? (Hard to tell when you don't post any code or tell us which filetype you are changing)

To turn off virtualization, make sure your script contains RequestExecutionLevel admin .

You can force NSIS to use the 64 bit registry with SetRegView but it is probably a better idea to monitor the installer with Process Monitor so you can see where you are actually writing. You can then monitor explorer.exe to see where it is reading from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM