mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
i've heard that on vista, the file path handling is different then on other os's? is this true?

can i still use $scriptdirfolder and $mircdiranotherfolder as usual?

Joined: Nov 2007
Posts: 19
J
Pikka bird
Offline
Pikka bird
J
Joined: Nov 2007
Posts: 19
This was only a problem in mIRC 6.3. In 6.31, mIRC installs to a Roaming folder.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Sorry, what is a roaming folder?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
"roaming"
In addition, start out a search for vista and $mircdir - you'll find plenty of posts about the "new" $mircdir behaviour.
Regards smile

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
thanks!

so it was only a problem on 6.3? so the rest of the versions are fine?

so on 6.3, $mircdir will point to the applications folder?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
All versions before 6.31 have this "problem". And it's not really a problem anyhow, depending on how you install. Of course, for the casual user who just installs normally, it acts like a problem, which is why it was changed.

In any case, you can avoid it with older versions of mIRC by installing mIRC to use the install folder rather than the Virtual Store folder by placing a mIRC.ini file into the install folder. Note that in Vista, you will want to set full access to that folder for your login to prevent issues with writing to the folder for logs/downloads/etc. As long as you give full access to the folder, it works the same in Vista as in pre-Vista.

Of course, you could also install mIRC to a location where you already have full access, such as a folder on the desktop, and you'll get the same results.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Sorry, my question was about how this affects mirc scripting, nothing to do with me installing mirc on vista or whatnot.

i don't use vista, my question is about making scripts compatible on vista as well as xp

so i guess i'll just put a version check to make sure the mirc version != 6.3

Last edited by pouncer; 29/11/07 10:51 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The easiest way to ensure this, is to go through your scripts and replace $mircdir with $scriptdir

As to the version check, not a bad idea, but I'd recommend using $version < 6.3 rather than $version != 6.3

I believe you're knowledgeable enough to see why.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
You definitely should not just replace $mircdir with $scriptdir. It's a really scrappy method and forces the user to install the script files somewhere that can be written to by all users which is as good a reason as any to not install that script.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
then how about an alternative suggestion?

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
The post I linked explained it.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sorry, for some reason it didn't show as a link when I pointed at it.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Hi starbuck, thanks for linking to that thread. I am still very very confused, can someone kindly please help me further?

so the issue is with mirc 6.3 on vista.

say i have a folder in my script directory called 'scripts' and in this folder i have script1.mrc

if i use $mircdir in script1.mrc will it NOT return the script directory folder? but it WILL return the scriptdirectory/scripts folder?? right? on my xp, im using $mircdir in all my scripts, and these scripts are in a subfolder ... so this would be a problem on vista?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
$mircdir in Vista will point to wherever mIRC.ini is located, wheter that is your mIRC folder or the one in Appdata depends on the user's installation. $scriptdir will point to wherever the script is installed.

If you use $mircdir\scriptname\whatever, and someone puts the script into the mIRC installation folder instead of in the Appdata location, then it will point to the wrong location. I think people need to consider installing scripts into the Appdata location in the future, but that doesn't help for everyone who chooses not to. $scriptdir should point to the correct location no matter how people have things set up in Vista... just remember that you cannot write to the mIRC install folder without changing settings, so if you are writing settings, you will not want to use $scriptdir.

A good option is to use $scriptdir for locating the actual script, and then saving all settings into $mircdir\scriptname\ or whatever. Using a combination of both should allow things to work regardless of how people have things set up... your settings will just not be in your mIRC install folder.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
OK, I'm going to try and thoroughly explain what's going on. Hopefully this will make some sense:
  • There's nothing special about how $mircdir and $scriptdir work on Vista. They behave the same as they do on any other version of Windows.

  • The actual behaviour of $mircdir and $scriptdir has not changed at all. To clarify what those behaviours are:
    - $mircdir is the 'root' directory. This is the place where any relative filenames will start from, and it is the place that mIRC will look for the mirc.ini settings file (unless that's been overridden using mIRC's -i command-line switch).
    - $scriptdir always points to the directory containing the currently executing script.

  • What has changed from v6.3 onwards is the default locations that mIRC uses for storing settings. I cannot stress enough that this doesn't affect how $mircdir works and that any script that correctly uses $mircdir prior to 6.3 will continue to work correctly after 6.3. The problem is that prior to 6.3 a lot of people apparently misunderstood what $mircdir did, and thought that it always returned the directory containing mirc.exe (because versions prior to 6.3 used to store settings there by default).


From all this we can figure out a few things:
  • $mircdir can always be assumed to be a writeable location for the given user, $scriptdir cannot - ie. a script could be installed by an admin but used by a non-admin who has read-only access to the script's directory.

  • $mircdir will always return a directory so that your script behaves appropriately for how the user has set up mIRC. What I mean is that whether the user has chosen to use mIRC in a multi-user way (the default from 6.3 onwards) or whether they've chosen to use mIRC so that all users use the same settings (the pre-6.3 way) then by using $mircdir for storing your script's settings it will always work how the user wants it.


So in conclusion:

Anything that could be written by the user (ie. settings, savegames, downloads, whatever) should use $mircdir. Anything that will not be changed by the user (ie. script resources like icons or default sounds etc.) should use $scriptdir (which should be fairly logical since they'll presumably be installed there with the script files).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559

/me votes this post becomes a sticky, as this issue is asked time and again

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Much better explanation than mine. smile


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard