Archive: Unistall silent option and desktop refresh


Unistall silent option and desktop refresh
Hi,

NSIS Version: NSIS20a7

When user install a new version, I check the user already has older version of our product so that I can do a upgrade. Here upgrade is install new version and uninstall the older version!

All works fine if I do the followng:
1. install new version
ExecWait '"$0\Uninstall.exe" _=$0'
2. uninstall older version.

If the do the following, I get the desktop refresh issue:
1. install new version
ExecWait '"$0\Uninstall.exe" /S _=$0'
2. uninstall /S older version - now my destop icon is still displayed and if I do a manual refresh it goes away (right mouse button on desktop and clik "Refresh"). So the uninstall works fine but no refresh!

NOTE: Without /S option it refreshes properly.

In my *.nsi script I tried the following to refresh the desktop by SendMessage:
SendMessage 65535 26 0 0 ;

Screen flikers (refresh happens) but my old Icon is still visible.

Someone help me to resolve this issue.

Thanks....
Raj
:D


That is weird. Are you the code is executed succesfully? Try to add a messagebox.

You are also using a very old alpha version of NSIS 2. Upgrading is highly recommended.


Installed the latest NSIS 2.0 RC1 and tested the same, It seems the problem still exists.

Any quick fix?

Thanks,
Raj


Can you post the script code? The desktop should refresh automatically. Maybe it's a problem with your system, try another computer.


I couldn't get the "SendMessage 65535 26 0 0" to work either from a script. So, I wrote a DLL to refresh the desktop for me. I've attached it here with source if anybody else needs it. I only tested it under Win XP Pro so if anybody has any problems with it let me know. I also included an example script that creates 2 shortcuts on the desktop but 3 show up. Then it refreshes the desktop to only show the 2 that should be there. The bug appears to be a Windows bug because you can recreate the same problem by manually creating the shortcuts too. There are other instances that will cause the desktop shortcuts to mess up but this eaxmple was the easiest to recreate and test with.