Old 27th May 2003, 21:50   #1
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
1 Remaining Issue - Need Help

All files in the package have a target folder location.
($INSTDIR}\blah\blah

The "administrative" files (shortcuts, uninst.exe, etc.) have a target of:

${programfiles}\${mui_product}

All files deploy to the proper locations.
Uninstallation fails, however. No files are removed from:

($INSTDIR}\blah\blah

And it says I'm trying to remove "Start Menu\Programs" which I am not.

Can someone please tell me what I'm doing wrong and how to get this to work?

According to the logic in the documentation, there is no reason why this should not work; unless the writing of the uninstallation is not "smart enough" to remember where files were placed on the building of the installation exe.

Sigh. I'm so close.
Attached Files
File Type: nsi 7jg77skins_2.nsi (5.8 KB, 162 views)
Tolwyn is offline   Reply With Quote
Old 27th May 2003, 21:59   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Why not use:
code:

RMDir /r "$PROGRAMFILES\${MUI_PRODUCT}"


And...
Does the Uninstaller remembers the value for:
${MUI_STARTMENUPAGE_VARIABLE}
Doesn't this variable only for runtime during Intallation?
Maybe if you save the ${MUI_STARTMENUPAGE_VARIABLE} in the
registry then the uninstaller recover that value...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 27th May 2003, 22:08   #3
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Haven't a clue about runtime.
Seems to me, the uninstaller should be written knowing where the user has chosen to install the files.

I wouldn't know how to write that value to the registry and call it later.
Tolwyn is offline   Reply With Quote
Old 27th May 2003, 22:12   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
The StartMenu.nsi example shows you how to store it in the registry (using MUI defines).
Joost Verburg is offline   Reply With Quote
Old 27th May 2003, 22:16   #5
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Sorry, Joost.
I don't get how to apply what is in the example script to my script. That to me is one of the biggest problems with NSIS--examples between scripts don't "port" that well to other scripts.

I'm just not sure how to do it.
Tolwyn is offline   Reply With Quote
Old 27th May 2003, 22:19   #6
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Yeah. This just doesn't make sense to me.
None of the files I've deployed are being deleted when the uninstallation section seems to be perfectly legal.

The Start Menu program group created is not getting deleted.

The ONLY thing being deleted correctly is the Program Files\${MUI_PRODUCT} folder and its contents.
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 13:02   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Your $INSTDIR defauls to "$PROGRAMFILES\Forgotten Battles" (InstallDir command) but you are writing the uninstaller to "$PROGRAMFILES\${MUI_PRODUCT}" which is "$PROGRAMFILES\7JG77 Skin Pack". You should always use $INSTDIR. The uninstaller initializes $INSTDIR to the directory it lies in.

As for the start menu, this is the part of the example you need (notice the .lnk files deletion):

code:
!insertmacro MUI_STARTMENU_DELETE_BEGIN ${TEMP}

Delete "$SMPROGRAMS\${TEMP}\Modern UI.lnk"
Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk"
RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts

!insertmacro MUI_STARTMENU_DELETE_END


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 16:19   #8
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Ok. Thanks, Kichik.

Will the uninstaller remember or know what to substitute ${TEMP} with? Will it be able to pull the variable from installation MUI_STARTMENUPAGE_VARIABLE ($9) ?
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 16:22   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
As TEMP is a define, and is a compile time "variable" it will be "remembered" in the uninstaller too. Everytime the compiler sees ${TEMP} it just replaces it with its value, $9 in this case.

The value inside $9 will not stick to the uninstaller but this line:
!insertmacro MUI_STARTMENU_DELETE_BEGIN ${TEMP}
reads it from the registry for you.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 16:33   #10
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
When did it get written TO the registry?
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 16:35   #11
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
In the MUI_STARTMENU_WRITE_BEGIN macro.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 16:36   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Nope, wrong one. It's in the MUI_STARTMENU_WRITE_END macro and only if MUI_STARTMENUPAGE_REGISTRY_ROOT, MUI_STARTMENUPAGE_REGISTRY_KEY and MUI_STARTMENUPAGE_REGISTRY_VALUENAME are defined. Define those and the MUI macros will take care of the writing and reading. You should still delete though.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 16:52   #13
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Angry Fix one thing, breaks another...

Kichik. This has all just made everything worse.
I define one thing, something else breaks. I fix that, and it breaks something else.

I'm getting the error:
!insertmacro: macro named "MUI_STARTMENU_DELETE_BEGIN" not found!

Can you look at this and tell me where I've screwed up?

code:

!define MUI_STARTMENUPAGE
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${MUI_PRODUCT}"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "$9"



I have this before the language macro (which needs to be last)...

I use $9 because that is the variable that will hold the users' custom Start Menu group if they don't choose default, right??
Attached Files
File Type: nsi 7jg77skins_7.nsi (7.4 KB, 152 views)
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 16:54   #14
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
How do I populate the MUI_STARTMENUPAGE_REGISTRY_VALUENAME without redefining the reserved variable $9 ??

If $9 contains the user's choice for SMPROGRAMS, then how do I populate that choice as a variable in MUI_STARTMENUPAGE_REGISTRY_VALUENAME without redefining the very same variable??
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 17:09   #15
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Right, that's an addition in the latest CVS version. Use:

code:
;Remove shortcut
ReadRegStr ${TEMP} "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"

StrCmp ${TEMP} "" noshortcuts

Delete "$SMPROGRAMS\${TEMP}\Modern UI.lnk"
Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk"
RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts

noshortcuts:



To remove the shortcuts (taken from the StartMenu.nsi example).

MUI_STARTMENUPAGE_REGISTRY_VALUENAME is $9. When you define MUI_STARTMENUPAGE_REGISTRY_VALUENAME as $9 the compiler just replaces every ${MUI_STARTMENUPAGE_REGISTRY_VALUENAME} with $9, that's all, it's not another variable. Its value is set after the start menu page shows.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 17:16   #16
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
No...
MUI_STARTMENUPAGE_VARIABLE is $9.
Not MUI_STARTMENUPAGE_REGISTRY_VALUENAME ??

What populates MUI_STARTMENUPAGE_REGISTRY_VALUENAME if the user chooses their own custom Registry entry?

How do I !define this variable without stepping on the toes of the MUI_STARTMENUPAGE_VARIABLE, which is $9 ?

I have to put SOMETHING in quotes after MUI_STARTMENUPAGE_REGISTRY_VALUENAME. Since I don't want to hardcode anything, I need that variable to write to the registry whatever the user chooses if the user does not choose my suggested default!
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 17:24   #17
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Besides, using your example, I get a new error:

Usage: ReadRegStr $(user_var: output) rootkey subkey entry
root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD)
Tolwyn is offline   Reply With Quote
Old 28th May 2003, 17:25   #18
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
MUI_STARTMENUPAGE_REGISTRY_VALUENAME is the registry value name. It has nothing to do with MUI_STARTMENUPAGE_VARIABLE. It is not the value itself, just the name that identifies the value. You should name it something like "Start Menu Folder", just like in the example.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 17:26   #19
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
That's because you have not defined TEMP. Either use:

!define TEMP $R9

or replace every ${TEMP} with another variable.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th May 2003, 17:34   #20
Tolwyn
Member
 
Join Date: Sep 2001
Posts: 86
Kichik.
Where do I donate $$ to WinAMP and NSIS?

My installer now works. I GREATLY appreciate your time in helping me through my frustration and learning curves.
Tolwyn is offline   Reply With Quote
Old 29th May 2003, 09:45   #21
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Thanks, I'll check and let you know

Good luck with your installer.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 30th May 2003, 14:44   #22
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
As Winamp and NSIS are two different projects there is no one place to donate for both. To donate to Winamp you need to donate to Nullsoft and as for NSIS, I have sent you a PM with a mailing address.

Thanks

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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