MoshiachNow
25th November 2007 09:09 UTC
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 15:21 UTC
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 06:13 UTC
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 09:30 UTC
What is wrong with typing "$SMPROGRAMS\$StartMenuGroup\cx250 tools\"?? Or even "$SMPROGRAMS\cx250\cx250 tools\"??
Stu
MoshiachNow
26th November 2007 09:59 UTC
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 10:11 UTC
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 11:09 UTC
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 13:43 UTC
Then either delete the original first or create your own with a different name or in a different folder.
Stu