View Full Version : FREE: GlobalPaths Action Plugin
Centauri Soldier
08-06-2009, 04:36 PM
Why a GlobalPaths Plugin?
Well, have you ever noticed that the _SourceFolder global variable doesn't always to the trick? Although it has many situations in which it works well, it is not always reliable which makes accessing its sub-folders impossible at times.
Of course, this depends entirely on whether or not the project is compiled and what type of compiling method you use (Web/Exe, Hard Drive etc.).
But wouldn't things be simpler if you never had to consider that issue? I would say...Yes!
Additionally, your path variables are shortened (just a little beneficial side effect of using the plugin).
What the GlobalPaths Plugin Does
Fortunately there is a solution...A GlobalPath Solution. I have been using this script for over a year now and would not build a project without it. Once it has been run, you never have to worry about where your folders are located again.
Your Docs folder is always _Docs. The same goes for _Audio, _Scripts, _ExeFolder and all the rest no matter if and how your project is compiled. No scripting is needed either, simply activate the plugin and you're ready to go.
Optional Integration
I have included, in the help file, a way to add the GlobalPaths global variables to Intellisense if you so desire (although this step is not necessary).
As always, please feel to send me any bug reports or suggestions.
So there you go...Problem solved!
Enjoy! :D
rexzooly
08-12-2009, 08:36 AM
Why a GlobalPaths Plugin?
Well, have you ever noticed that the _SourceFolder global variable doesn't always to the trick? Although it has many situations in which it works well, it is not always reliable which makes accessing its sub-folders impossible at times.
Of course, this depends entirely on whether or not the project is compiled and what type of compiling method you use (Web/Exe, Hard Drive etc.).
But wouldn't things be simpler if you never had to consider that issue? I would say...Yes!
Additionally, your path variables are shortened (just a little beneficial side effect of using the plugin).
What the GlobalPaths Plugin Does
Fortunately there is a solution...A GlobalPath Solution. I have been using this script for over a year now and would not build a project without it. Once it has been run, you never have to worry about where your folders are located again.
Your Docs folder is always _Docs. The same goes for _Audio, _Scripts, _ExeFolder and all the rest no matter if and how your project is compiled. No scripting is needed either, simply activate the plugin and you're ready to go.
Optional Integration
I have included, in the help file, a way to add the GlobalPaths global variables to Intellisense if you so desire (although this step is not necessary).
As always, please feel to send me any bug reports or suggestions.
So there you go...Problem solved!
Enjoy! :D
Yay something i wanted for sometime yay you must be that man in the red suit eveyone talks about :D
mystica
08-12-2009, 09:31 PM
I've just been downloading a whole bunch of your plugins ... far out man, you've been a busy beaver, what! :eek:
You know, my archive of plugins has recently grown to 75mb ... about twice the size of the native AMS install! And it just keeps getting better, thanks to the hard work of guys like you.
Might just have to appeal to IR, to make you an immortal. ;)
Centauri Soldier
08-12-2009, 11:36 PM
I've just been downloading a whole bunch of your plugins ... far out man, you've been a busy beaver, what! :eek:
You know, my archive of plugins has recently grown to 75mb ... about twice the size of the native AMS install! And it just keeps getting better, thanks to the hard work of guys like you.
Might just have to appeal to IR, to make you an immortal. ;)
Immortal huh? Exactly how many plugins do I need to make to get that? :D
ShadowUK
08-13-2009, 05:40 AM
Huh. I only have 11mb of plugins where 24 are action plugins and 16 are object plugins.
Centauri Soldier
08-17-2009, 07:58 PM
Version 1.1.0.0
GlobalPaths.SetDataFolder();
Added the ability to change the primary data folder name.
GlobalPaths.RegisterPaths();
Added the ability to create variables for all _ExeFolder directories.
Centauri Soldier
08-18-2009, 12:25 AM
Version 1.1.1.0
Fixed a bug that allowed variables to have spaces in them.
nitro
08-29-2009, 03:13 PM
When I didn't see the download link in the first post I started to panic xD
Centauri Soldier
08-30-2009, 02:28 AM
When I didn't see the download link in the first post I started to panic xD
Lol, yeah I was cleaning up all of my uploaded files and getting rid of all of the old versions. :lol
Hey Centauri,
I'm not sure what is happening here ... but it looks broken ... works sometimes, not other times ... this is my code ... for a web exe
TextFile.WriteFromString( _ExeFolder .. "\\GetServerList.cmd", "ECHO Please wait...\r\nSQLCMD.EXE -L > ServerList", false);
Shell.Execute( _ExeFolder .. "\\GetServerList.cmd", "open", "", "", SW_MINIMIZE, true);
The CMD does get created at _ExeFolder .. but doesnt run, instead I get another one running...
this is a screen shot of the CMD actually running ... as you can see, it is still going to a temporary path.
This was happening in the old version and now have upgraded and it still happens ...
http://www.indigorose.com/forums/attachment.php?attachmentid=8779&stc=1&d=1256788019
Centauri Soldier
10-29-2009, 12:20 AM
Since I'm not running any SQL software, I had to modify your code a bit to test it. It seemed to work fine with this test.
TextFile.WriteFromString( _ExeFolder .. "\\GetServerList.cmd", "ECHO Please wait...\r\ncmd.exe", false);
Shell.Execute( _ExeFolder .. "\\GetServerList.cmd", "open", "", "", SW_MINIMIZE, true);
Is it possible that your SQL call needs to be passed as something different than a string?
Centauri Soldier
10-29-2009, 10:05 AM
Oops, I forgot to compile as a web/exe. Now I see your problem. When I test the _ExeFolder variable value using a dialog it comes up with the correct info. Also the GetServerList.cmd file is created where it should be but for some reason the path shown in the DOS window is a temp folder.
I think this a problem with the compiled program attempting to communicate with DOS. The paths are all correct but DOS is just not getting the right information. I'll keep trying and see if I can come up with a work-around.
Excellent thank you very much, love the plugin otherwise :) no probs ever
Centauri Soldier
10-31-2009, 01:45 AM
So here's what's happening Boku. When DOS is opened it does not set its default path to the same path where the open file(GetServerList.cmd) exists but rather to the calling program's path.
Since a compiled exe is decompressed and put into a temp folder, the actual calling program is the autorun.exe and it's path (the temp folder) is set as DOS's default path.
I did find a work around for this though. Instead of using Shell.Execute(), use File.Run() and set the Working Folder parameter to be the same as the location of your file to opened (in your case that would be the _ExeFolder).
Hope this helps,
Centauri Soldier.
mystica
10-31-2009, 02:34 AM
Location: I come from a land down under Where beer does flow and men chunder
Hey Boku ... that's really gross, man! :D
PS.
Which part of Australia?
Haha :) ... I live in Perth mate
mystica
10-31-2009, 03:42 AM
Ah well, that explains it ... bloody Western Australians. Nah, just kidding man! (Nice city!) :p
So here's what's happening Boku. When DOS is opened it does not set its default path to the same path where the open file(GetServerList.cmd) exists but rather to the calling program's path.
Since a compiled exe is decompressed and put into a temp folder, the actual calling program is the autorun.exe and it's path (the temp folder) is set as DOS's default path.
I did find a work around for this though. Instead of using Shell.Execute(), use File.Run() and set the Working Folder parameter to be the same as the location of your file to opened (in your case that would be the _ExeFolder).
Hope this helps,
Centauri Soldier.
Thanks mate this works a treat :)
Ah well, that explains it ... bloody Western Australians. Nah, just kidding man! (Nice city!) :p
Yeah its not too bad, very nice women here!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.