Archive: Upgrading versions


Upgrading versions
Hi,

I have a couple of questions that I'm hoping someone could answer for me. We are still using version 2.01 of The NSIS. If we upgrade to the latest version will we have to update our scripts or will they run under the newer version?

Second using the 2.01 I'm building an update to one of our programs. When it's installed over an older version the icon for the desktop and start menu don't update to the newer icon.
If I change the display settings in XP or Vista then the icon updates. Is there a way to force Windows to update the icon?

Thanks in advance


Some minor mods may be needed, like it would be recommended that you switch to MUI2.nsh

Why not install on another machine and try compiling from there?

Stu


Thanks for the info I set up the newer version on another machine.

In regards to this question,

When it's installed over an older version the icon for the desktop and start menu don't update to the newer icon.
If I change the display settings in XP or Vista then the icon updates. Is there a way to force Windows to update the icon?

I've read somethings about the RefreshShellIcons

Is this the only way to do this? If it is what is the syntax to force a refresh of a desktop and start menu icon?


From Examples\makensis.nsi (the NSIS install script):

!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0

System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

Edit: Similar code at:
http://nsis.sourceforge.net/Refresh_shell_icons

Stu


I can't get it to work for some reason.

Is there anything else I'd need to have in the script for it to work?


Are you pointing to an ico file or an exe file?

Stu


Please try this code as well:


!define SPI_SETNONCLIENTMETRICS 42
ClearErrors
ReadRegStr $R0 HKCU `Control Panel\Desktop\WindowMetrics` `Shell Icon Size`
IfErrors 0 +2
StrCpy $R0 32
IntOp $R1 $R0 + 1
WriteRegStr HKCU `Control Panel\Desktop\WindowMetrics` `Shell Icon Size` $R1
SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} ${SPI_SETNONCLIENTMETRICS} 0 /TIMEOUT=10000
WriteRegStr HKCU `Control Panel\Desktop\WindowMetrics` `Shell Icon Size` $R0
SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} ${SPI_SETNONCLIENTMETRICS} 0 /TIMEOUT=10000


Edit: if not using MUI, make sure you !include WinMessages.nsh.

Stu