Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 9th December 2011, 08:50   #1
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
modify path startIn Icons

Hi,
can you help me please,

I want to do an install of .exe, the installation wil be ok and the startin of my icons is for All Users.
i have many users to use shortcuts they copy it on her computers, i want when they start icons, the path of start in change with the current user.

can i do that please?
hanenjom is offline   Reply With Quote
Old 9th December 2011, 09:32   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
"I want to create a shortcut for all users, but the working directory of the shortcut must be different for each user."

Is that what you mean? If so, then you need to put an environment variable in the working directory, such as "%LOCALAPPDATA%\YourApp\WorkDir". I'm not sure if this is possible using standard NSIS commands, as the workdir is set through SetOutPath, and it might convert the variable to a path. Try it.
MSG is online now   Reply With Quote
Old 9th December 2011, 12:43   #3
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
I try the $APPDATA and it's don't work .

I create my exe in a server and i have many users, they copy the shortcuts, I want to have for each user his path in the start in.

for example my Startin in the server is "\Documents and Settings\All Users\Start Menu\Programs" , and I want If XY copy the shortcut in his computer he will have startin: "\Documents and Settings\XY\Start Menu\Programs".

Thx.
hanenjom is offline   Reply With Quote
Old 10th December 2011, 06:06   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
You should not use an NSIS variable like $APPDATA. You should use an environment variable, such as %APPDATA%.

But again, I'm not sure if this is possible in the 'normal' NSIS way. Try it:
SetOutPath "%APPDATA%\YourApp\Workdir"
MSG is online now   Reply With Quote
Old 12th December 2011, 08:12   #5
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
thx for your answer,

but how can I get the value of %APPDATA% for each user when he copy the icons in his work directory?

i search and i can't have a solution for that

can you help me please.
Thx.
hanenjom is offline   Reply With Quote
Old 12th December 2011, 08:18   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
You should NOT get the value, that's the whole point. You need to leave it as the exact string, "%APPDATA%", so that Windows can determine it by itself when the shortcut is executed.
MSG is online now   Reply With Quote
Old 12th December 2011, 12:48   #7
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
Thx for your help, it's working, just i have a last problem i use two os xp and seven and I can't use the some path for both.

For Xp I use "%USERPROFILE%\start Menu \programs"

For Seven I use "%APPDATA%\Microsoft\Windows\Start Menu\programs"

How can I have the path for both?

Can you help me please.
Thx
hanenjom is offline   Reply With Quote
Old 12th December 2011, 13:30   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
Please do not set Start Menu as the working folder........
MSG is online now   Reply With Quote
Old 12th December 2011, 14:46   #9
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
why I don 't do that ? it poses a problem to do it ?
hanenjom is offline   Reply With Quote
Old 12th December 2011, 16:07   #10
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
You don't want your application to store files in the start menu, do you?
MSG is online now   Reply With Quote
Old 12th December 2011, 16:14   #11
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
is not a problem for my application to do that.
hanenjom is offline   Reply With Quote
Old 12th December 2011, 17:21   #12
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,775
Quote:
Originally Posted by hanenjom View Post
is not a problem for my application to do that.
Yes it is a problem, you cannot let the user store files in the start menu.

If your application depends on the working dir then set it to the required folder, if not, set it to $windir, $instdir or something like that.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th December 2011, 18:54   #13
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
There is one case where it wouldn't be a problem if you set the working dir to the start menu: If the application only creates start menu shortcuts.

For anything else, it is indeed a problem. You should not store normal files in the start menu.
MSG is online now   Reply With Quote
Old 13th December 2011, 09:44   #14
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
thx for your answers ans explications, I will change it .
hanenjom is offline   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