Old 11th May 2005, 19:47   #1
cakira
Guest
 
Posts: n/a
Uninstall and StartMenu registry

Hello!

I created a script for installing a program and, based in a Modern UI example (I don't remember the filename), I configured it to create a shortcut in the StartMenu. The installer creates it with no problems.

But, after uninstalling the program, I still find an entry in the registry. The entry is:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu2\Programas\Tomodachi

Where "Tomodachi" is my application's name.

I've seem no reference to it in the manuals and I think it's name is different under Win98 and I think this entry is duplicated somewhere else in the registry...

Can I delete these registers? Should I delete them? How can I delete them?

Just for reference, I'll put below the pieces of my script that seems related to the startmenu.

Thank you!

Akira

----------------------

...
!insertmacro MUI_PAGE_DIRECTORY

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Tomodachi"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"

!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER

!insertmacro MUI_PAGE_INSTFILES
...
;--------------------------------
;Installer Sections

Section "Install"
...
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Tomodachi 0.3.lnk" "$INSTDIR\tomodachi.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"

!insertmacro MUI_STARTMENU_WRITE_END
...
;**********
;Uninstaller Section

Section "Uninstall"

...

!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP

Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Tomodachi 0.3.lnk"

;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"

startMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."

IfErrors startMenuDeleteLoopDone

StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:

DeleteRegKey /ifempty HKCU "Software\Tomodachi"

SectionEnd
  Reply With Quote
Old 11th May 2005, 22:18   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 3,288
This is (as you can tell from the registry path) sorting info for the start menu.
If you want to delete those items I think you have to kill explorer since it probably writes them out on exit.
In my own installers I dont remove this item, but it should go away if the user does a "Sort by name" in the folder containing your item (Programs)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th May 2005, 22:57   #3
MichaelFlya
Member
 
MichaelFlya's Avatar
 
Join Date: May 2005
Location: U.S.A.
Posts: 91
Seems to be How Windows Saves your Order for your Folders of
the Start Menu... It only Appears after you install your Program
and only Appears Once you have Opened that Programs Menu
Folder.

Anyways it Doesn't Seem to be a Problem However if you want
to Remove it Just include this Line. Under your Other Will Work.
Like this.

code:

DeleteRegKey /ifempty HKCU "Software\Tomodachi"

DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu2\Programas\Tomodachi"



That will Delete it and anything Else you have Under it.

After looking at it's Path I have Programs under that Section I
haven't Had Installed for Months... So The only way to Delete
it is to do it by Hand or By Getting your Installer or Uninstaller
to Delete it.

The Only Difference was "Programas" was Spelled "Programs".

Spanish Windows.. heh...

-MichaelFlya-

Last edited by MichaelFlya; 11th May 2005 at 23:26.
MichaelFlya is offline   Reply With Quote
Old 11th May 2005, 23:33   #4
cakira
Guest
 
Posts: n/a
First of all, thank you for your attention.

Quote:
Originally posted by Anders
This is (as you can tell from the registry path) sorting info for the start menu.
If you want to delete those items I think you have to kill explorer since it probably writes them out on exit.
In my own installers I dont remove this item, but it should go away if the user does a "Sort by name" in the folder containing your item (Programs)
I've just tried. I reordered the menu, "shutdowned" windows, reordered the menu again, manually mixed the menu order and reordered the menu once again. The register was aways still there.

Quote:
Originally posted by MichaelFlya


Anyways it Doesn't Seem to be a Problem However if you want
to Remove it Just include this Line. Under your Other Will Work.
Like this.

code:

DeleteRegKey /ifempty HKCU "Software\Tomodachi"

DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu2\Programas\Tomodachi"



That will Delete it and anything Else you have Under it.

After looking at it's Path I have Programs under that Section I
haven't Had Installed for Months... So The only way to Delete
it is to do it by Hand or By Getting your Installer or Uninstaller
to Delete it.
So it seems...

But making the Uninstaller to delete it doesn't look to be that simple because I've seem that this path is slightly different under Win 98. And as I said Win XP (and perhaps Win 98) duplicates this entry under \HKEY_USERS\some_weird_numbers\Software\.......

Well, I don't understand windows registry, so I think the best aproach is: "If it works, DON'T TOUCH". I mean, I'll left it as it is.

Quote:
The Only Deference was "Programas" was Spelled "Programs".

Spanish Windows.. heh...
No.

Portuguese Windows, English names in the register and fingers that keep spelling in Portuguese even against my will :-)

Anyway, thank you again!

Akira
  Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump