engsoft
28th April 2009 18:21 UTC
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
Afrow UK
28th April 2009 20:18 UTC
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
engsoft
29th April 2009 17:26 UTC
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?
Afrow UK
29th April 2009 21:30 UTC
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
engsoft
29th April 2009 21:59 UTC
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?
Afrow UK
29th April 2009 22:42 UTC
Are you pointing to an ico file or an exe file?
Stu
Afrow UK
29th April 2009 22:52 UTC
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