Old 15th April 2013, 09:21   #1
Carolus
Junior Member
 
Join Date: Apr 2013
Posts: 4
NSIS - Control folder location in Start-Menu

Hi,

I have done NSIS script that performs silent installations on several setup files (.exe).

They end up on different default locations/folders in the Start menu, since I have not specified where to place them, and I don't know how.

The reason is that some of these installed programs are pointless to have as stand-alone programs, as they depend on the "Main" installed program to run.

So, what I want to do is to control, in the NSIS script, that some of the program folders are placed inside/under the "MAIN"-program folder in the Start-menu.

How do I do this? Is it possible?

BR
Carolus
Carolus is offline   Reply With Quote
Old 15th April 2013, 10:24   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can either just delete those short cuts and then create your own after running the silent installers, or just move them using Rename. You can just move the entire folders under your own.

Stu
Afrow UK is offline   Reply With Quote
Old 15th April 2013, 12:03   #3
Carolus
Junior Member
 
Join Date: Apr 2013
Posts: 4
Hi,

Thanks for your reply.

Could you please show an example of this?

I tried to 'move' som program folders using createshortcut, but that doesn't work.

BR,
Carolus
Carolus is offline   Reply With Quote
Old 15th April 2013, 12:11   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
As I said, use the Rename instruction. You can move files and folders using it.

Stu
Afrow UK is offline   Reply With Quote
Old 16th April 2013, 12:25   #5
Carolus
Junior Member
 
Join Date: Apr 2013
Posts: 4
Hi,

Thanks.

I am of course doing somehting wrong, it doesn't work.

I tried, after the silent installation calls (ExecWait....) on one of the 'sub-apps' with this:

; There is a space in MikTex 2.9 folder name
Rename "$SMPROGRAMS\MikTex 2.9" "$SMPROGRAMS\doxygen\MikTex 2.9"

; Also tried to remove the directory entirely
RMDir /r "$SMPROGRAMS\MikTex 2.9"

The creation of the installation .exe works and the installation goes through, but the folder is NOT moved, or deleted in the latter case.

BR,
Carolus
Carolus is offline   Reply With Quote
Old 16th April 2013, 12:56   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Are you sure you're in the proper user context? SetShellvarContext all or current? Also, if current, are you at the proper access level (elevated/admin vs userlevel)?

Put a MessageBox MB_OK "$SMPROGRAMS" in front of your delete command to see which path you're actually trying to delete.
MSG is offline   Reply With Quote
Old 16th April 2013, 13:54   #7
Carolus
Junior Member
 
Join Date: Apr 2013
Posts: 4
Hi,

Thanks.

You are abolutely right. I have only tried the delete command so far.

I copy-pasted the path in the delete command:
RMDir /r "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MikTex 2.9"

And that worked. But that does not look very elegant though. How should it be if I want to use some pre-defined path constant and delete the same directory, in the correct context?

BR,
Carolus
Carolus is offline   Reply With Quote
Old 16th April 2013, 13:56   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
As MSG said you need to use SetShellvarContext all to change the context of the path constants (that path is for all users, so use all).

Stu
Afrow UK 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