You are here

[Solved] PA Launcher environmental variables

17 posts / 0 new
Last post
vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
[Solved] PA Launcher environmental variables

I am working in SyncDocs and have most of it worked out, my questions is that I know (from reading) that NSIS supports $Desktop as a known environmental variable I do not see this listed in the PA Launcher manual. Is it a hidden feature or does it recognize Desktop or do I need custom code?

Basically I need to on launch of program move a shortcut from the Data folder to the desktop then back again on program close. The Desktop feature of NSIS seems the one to use but it just does not seem to want to work.

Edited appears that %USERPROFILE%\desktop will work for me just curious now if maybe the variable for desktop could be added to PA Launcher?

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
English only

What you have will work on English systems only. Put the following in Pre custom code instead:

SetShellVarContext current
${SetEnvironmentVariablesPath} DESKTOP $DESKTOP

Then you can use %DESKTOP% in launcher.ini

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Init

Things like that belong in Init, not Pre.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Wasn't sure

I wasn't sure if it would work in Init, and I'm not at my computer to test it, so I put it in Pre to be safe, since the default variables have already been set at that point. If it'll work in Init, I agree, that is the best place for it.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Code

Seems to not be recognized as a variable it moves the info to the Apps root in a folder called %Desktop% not sure if I implemented it correctly? No worries was just a thought

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
launcher.ini

Could you post the contents of your launcher.ini, and Custom.nsh, please?

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Which

The one that works or the one that doesn't?

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Doesn'T

Whatever you're using that moves it to app's root, as you indicated.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
hope this is what you mean

http://pastebin.com/KniBr2cR custom.nsh
http://pastebin.com/F3DQi5Ei launcher.ini

This is for the DESKTOP move you suggested

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Backslash

Get rid of the backslash after %DESKTOP% in launcher.ini, then it should work.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Originally

tried it without slash and got same results so I tried it with
Neither way seemed to work

OK here is what I did apparently I need to rebuild the launcher because after I did that and without the backslash it worked

Thanks

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
glad

Glad to have helped.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
you always do

I will use it next month on the new release, since I just uploaded a dev 2 don't want to scare anyone off with a dev 3 right off lol

They update the base app every month or so.

BTW no more emails from me lol for now on I will be on my own lol

Still think it should be imported into launcher though IMHO

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 day 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Strongly encourage

As this is a legitimate reason to put out dev 3, and fairly simple to do so, I strongly encourage you to do so, as opposed to holding off.

Also, there are very few cases in which anything should be put on a user's desktop, so not having it directly supported is not a bad thing, in my opinion, anyway.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
???

Currently it is being handled via the UserProfile setting, also It is basically only an English program But you know best. The only reason why I needed it is that by default the folder link goes to desktop, if not there it creates one. So by moving it back and forth it "fixes things"

Upload in progress guess there goes my credibility with base app developers

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 2 hours 15 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Desktop env var is difficult

Unfortunately there are a couple of ways to place things on the desktop, making it hard to add a single environment variable to cover it.

Wouldn't it be more worth petitioning for a [FilesRemove] (or [FilesDelete] to differentiate the name for readability), or maybe a modification to [FilesMove] where -=Place\Where\The\File\Is\filename would delete instead of copy to the Data directory?

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Why?

in this case it would recreate the shortcut each time it is launched. My original question was more to do with why NSIS used the variable and PA Launcher did not. No biggie though as Gord and Chris resolved it for me. And actually it is an option in the base app to not create a desktop icon but it is a PITA to find and I can not use a default xml since the xml has many other options that are set up per account. I am happy with what there is, was just wondering why it was not part of it

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Log in or register to post comments