3

I have an installer (NSIS) that creates shortcuts in start menu. When I remove the program uninstall removes the folder from:

C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\

unfortunately the folder is still in start menu. Maybe it's just a matter of refreshing the start menu - but how to do it from NSIS uninstaller?

kyrisu
  • 4,541
  • 10
  • 43
  • 66

2 Answers2

7

Win7 is probably doing the same as Vista, and copies/moves the shortcuts to the all users start menu without telling you. Stop this by using RequestExecutionLevel in your script.

See http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista

Chris Charabaruk
  • 4,367
  • 2
  • 30
  • 57
Anders
  • 97,548
  • 12
  • 110
  • 164
  • 3
    Two people down-vote the correct answer with no comments? Anders probably the most knowledgeable NSIS scripter on SO. – Kyle Gagnet May 22 '09 at 01:23
  • It's the Win7 "bashing" probably. If someone can give me a good reason why NSIS gets this treatment, I'll edit my post. – Anders May 22 '09 at 02:49
  • 1
    "Win 7 sucks..." or, maybe, nsis should behave correctly. MSI based installers don't have this problem... – Robert P Nov 11 '09 at 20:59
  • @Robert P: Of course MSI has no such issue, since its not even a executable (The real engine is part of the OS) This stupid behavior is for broken installers and since we don't have a time machine, even 100% working (older) installers will break since they don't have the required string in their manifest. MS turns on compatibility hacks for all installers and you have to opt out. (And the opt out method changes for every new version of windows!) – Anders Nov 13 '09 at 01:08
  • Bye-bye, bias in answer. Unfortunately I can't scrub comments the same way... yet. – Chris Charabaruk Jul 03 '11 at 19:20
  • That fix does not work for me on Win 7. It gives errors trying to create the lnk files in C:\ProgramData\blah... – sje397 Nov 03 '11 at 11:26
  • @sje397: You need to be administrator (requestexecutionlevel admin) – Anders Nov 05 '11 at 18:01
  • @Anders: I did that. No luck. 64-bit, 'home premium'. – sje397 Nov 07 '11 at 04:07
0

I don't have a copy of Windows 7 so I couldn't say for sure, but have you confirmed the folder you removed is the actual one from the start menu (I'm assuming it is since you created it initially).

You could go to the folder in the start menu, right-click, and open it.

Could be a dumb suggestion though. :)

Nick Spacek
  • 4,717
  • 4
  • 39
  • 42
  • Start Menu shortcut points to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ which is probably where the start menu options are cached but... after relogin those shortcuts are still there :/ Maybe there's a better way of deleting start shortcuts (while keeping it compatibile with the previous windows versions). As just a note: I didn't have those issues while using WiX – kyrisu May 21 '09 at 12:31
  • The reason I asked is because in XP and other versions of Windows there are two locations the Start Menu items come from: the user's directory and the "all users" directory. So my thought was that the shortcuts had been created in both but only deleted from one! – Nick Spacek May 21 '09 at 12:45