Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   how to change $SMPROGRAMS to a non default path (http://forums.winamp.com/showthread.php?t=282063)

MoshiachNow 25th November 2007 08:09

how to change default path to a non default
 
HI,

As simple one.

I need to change the link path for my program which currently is created under "Start->Programs" ($SMPROGRAMS).

The code is :

Section -post SEC0001
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
WriteRegStr HKLM "${REGKEY}" StartMenuGroup $StartMenuGroup
WriteUninstaller $INSTDIR\uninstall.exe
SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
SetOutPath $INSTDIR
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\colorserver_upd.exe
====================
How do I change the $SMPROGRAMS path to point to some non default link path (already existing) ?
thanks

Afrow UK 25th November 2007 14:21

I don't understand what you mean? Are you talking about the link start in path? That is set with SetOutPath.

Stu

MoshiachNow 26th November 2007 05:13

Yes,

I need to change the link only from $SMPROGRAMS to som eother customer created link.ex:

start->All Programs->cx250->cx250 tools

Afrow UK 26th November 2007 08:30

What is wrong with typing "$SMPROGRAMS\$StartMenuGroup\cx250 tools\"?? Or even "$SMPROGRAMS\cx250\cx250 tools\"??

Stu

MoshiachNow 26th November 2007 08:59

Thanks,I got it.
Another question.

the "cx250" is product dependent and I must get it from some envitomental variable.
Normally the variable %scisys% will hold: "c:/cx250".
What is the way to set param $product from the above to be equal to "cx250" ?
(I have no experience with doing this in NSIS environment...)
thanks

Afrow UK 26th November 2007 09:11

Assuming it is always X:/... then you could do this:

ReadEnvStr $R0 SCISYS
StrCpy $R0 $R0 `` 3

$R0 would now be your 'cx250'.

Stu

MoshiachNow 26th November 2007 10:09

Great !

I have now added :
section
#set the product link path
ReadEnvStr $Product SCISYS
StrCpy $Product $Product `` 3
StrCpy $StartMenuGroup "$Product\$Product Tools"

And installer creates the links as required under:
start->All Programs->cx250->cx250 tools

The problem is that the above link already exists,created by the cx250 product installation (It appears above the top separator line in start->all programs).
I need to install my staff there,without creating an extra identical link...
thanks

Afrow UK 26th November 2007 12:43

Then either delete the original first or create your own with a different name or in a different folder.

Stu


All times are GMT. The time now is 04:09.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.