Currently I'm testing a version of the SMPlayer launcher that redirects %USERPROFILE%
. However, it is well known that bMPlayer creates a folder called .dvdcss in the same directory, and MPlayer is executed by SMPlayer, not SMPlayer Portable. So therefore I would also need to redirect an app I'm not executing. This would probably be only achieved by modifying SMPlayer's code, but I don't know and am not intending to learn C++. I can almost be partly sure that I can make it so that the app I do execute ends up redirecting all other executions. Hm... I'll try that....
*About 732 hours later.*
Darn, not even general redirecting works...
Oh, well, guess I'll need to try some begging over at SMPlayer.
You are here
Redirecting an Env Var for an App you aren't executing.
June 10, 2008 - 3:29pm
#1
Redirecting an Env Var for an App you aren't executing.
The environment follows down the change.
SMPlayerPortable sets an environment variable and launches SMPlayer
SMPlayer inherits the environment from SMPlayer Portable. SMPlayer launches MPlayer.
MPlayer inherits the environment from SMPlayer.
Sometimes, the impossible can become possible, if you're awesome!
I thought it may work like that Thinstall topic said.
But too bad... It doesn't even support redirection...
Insert original signature here with Greasemonkey Script.
Nope, set env var in your launcher and MPlayer will inherit it in 2 steps. You need to do nothing more, it's just going to work.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
won't inherit it.
Insert original signature here with Greasemonkey Script.
it uses the variable you´re setting?
I have an App where I end up copying the files cause it uses variables strangely.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Good question.
Digitxp, you can use http://www.ii.uj.edu.pl/~adamczym/printEnvVars.exe to check this. Just rename it to mplayer.exe and put in the right directory.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
But I'm not sure if Mplayer will check...
Insert original signature here with Greasemonkey Script.
Try the tool. If it returns corrected env var value, then the problem is that MPlayer doesn't use %USERPROFILE% but i.e. CSIDL_PERSONAL. If it's so then you'll have hard time changing it from launcher. ^_^
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
A var? Reg entry?
Insert original signature here with Greasemonkey Script.
which makes it painful to alter on a per-application basis, since the value returned is global to the entire system
Google doesn't bite.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
Google just does happen to be blocked at school (SonicWALL is now blocking educational websites!!!!).
Insert original signature here with Greasemonkey Script.
http://msdn.microsoft.com/en-us/library/bb762494.aspx
http://msdn.microsoft.com/en-us/library/bb762181.aspx
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
It said CSIDL_Personal was to my Docs...
Insert original signature here with Greasemonkey Script.
My bad, should be CSIDL_PROFILE. Anyway you don't know yet if this is what MPlayer uses anyway. Go and ask on MPlayer forum or try to find it in sources.
Then use MS Detours (or another API hooking library) to catch the API call responsible for returning the path to user profile and replace it with something returns the one you want.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov
If it doesn't then it's SMPlayer's fault, it changes the environment.
I see 3 bad solutions.
-You can modify it's code, but maintenance will be painful.
-You can modify default user vars. Doesn't have to work and it's possible that in some cases (system crash, launcher process termination) you'll leave them invalid.
-AFAIR there are tools that modify other processes' environment. Find one that does it from command line and use as soon as MPlayer is launched (Can you detect it?). If there isn't one that does it, you can make one yourself, it's not that hard, especially as MPlayer is a windowed app and you can use SetWindowsHookEx to inject a dll into it. You need to write it in a compiled language though.
"Those people who think they know everything are a great annoyance to those of us who do." Asimov