MetaTrader 4 Build 600 with Updated MQL4 Language and Market of Applications Released - page 54

Ex Ovo Omnia
2920
Ex Ovo Omnia  
SDC:


The Windows OS in use and the status of UAC are both irrelevent. MT4 creates and uses the Data Folder regardless.


Correct. The UAC comes to a play only if the MT4 has been launched in portable mode.
Jade
969
Jade  
Ovo:

Correct. The UAC comes to a play only if the MT4 has been launched in portable mode.

On Windows XP if I launch the terminal.exe (in normal mode) the File/Open Data Folder is pointing back to that folder where the terminal.exe is.

Ian Venner
2397
Ian Venner  
Ovo:

Correct. The UAC comes to a play only if the MT4 has been launched in portable mode.
Even in portable mode UAC is not an issue except with Windows 8. Portable mode runs MT4 as admininistrator, without using the new data folder. MT4 has full read/write access to protected folders so UAC is effectively disabled. Except in windows 8, applications cannot get write permissions to protected folders. MQ recommends you do not use portable mode except on portable devices and pre-Vista OS's.
Ian Venner
2397
Ian Venner  
jade:

On Windows XP if I launch the terminal.exe (in normal mode) the File/Open Data Folder is pointing back to that folder where the terminal.exe is.

In that case I must have been wrong to say it uses the new data folder regardless, I apologize for contradicting you.
Ex Ovo Omnia
2920
Ex Ovo Omnia  
SDC:
Even in portable mode UAC is not an issue except with Windows 8. Portable mode runs MT4 as admininistrator, without using the new data folder. MT4 has full read/write access to protected folders so UAC is effectively disabled. Except in windows 8, applications cannot get write permissions to protected folders. MQ recommends you do not use portable mode except on portable devices and pre-Vista OS's.

What I wanted to point out - if it is not obvious - is that there is no reason to bother with UAC until I need the portable mode.

Actually I did not notice that MQ recommend to avoid the portable mode, while they keep guiding people how to set it up. Anyway, I do not care what they recommend right now, I care about software to work properly. I definitively need all my customers to have it set temporarily, regardless of the system they run and the device they own.

Ian Venner
2397
Ian Venner  

Far beit from me to tell you what to do, but I think it is worth considering that if you require clients to use portable mode for the reason you need write access to the terminal dir when the terminal dir is in Program Files, your code could be broken by Windows 8 and probably other future versions of Windows.

If you read information on the MSDN site you will see MS has been telling developers since Vista, that writing to Program Files is a big no no place. They implemented UAC virtualization to provide compatability with older programs but instructed devlopers to assume virtualization is a temporary feature. Therfore assume to not code apps requiring access to protected locations because in future they will get acccess denied with no virtual Program Files to be diverted to.

Case in point being, you can't disable UAC in Windows 8 by simply turning it off like in previous versions. Even though it still has the never notify option in user account settings, it doesnt do the same thing as before. Previously it actually disabled UAC, in Windows 8 UAC is still active. Never notify now means, if an application tries to access protected locations, just dont tell me about it. Application fails. The result of that will be users will think they have turned UAC off and will not be informed they haven't, their apps will just fail to write to files in protected locations.

I believe there are ways to fully disable UAC in Win8 by editing the registry or group policy security settings, the problem with that is the average user is not going to know how or probably wont want to mess with it and they will have got used to leaving UAC alone because modern applications are coded to be UAC compliant, like the new MT4 is.

I found some additional information about this, I think under Windows 8 the user can still do "run as administrator" (if they have access to an adminstrator account). That "should" allow MT4 apps to gain write access to the Program Files dir, but I dont think MT4 itself will use anything but the new data folder structure because the data folder dir is defined during the install, not at runtime so if UAC is enabled, (as is pretty much a given in Win8) The data folder will be the new one.

I think this is something to check: According to the docs, like I just mentioned, the location of the data folder is defined during the install. If the user has UAC turned off when they install MT4 the data folder "should" be defined in the terminal dir. But if UAC is enabled during the install the data folder is created and defined seperately in the appdata dir. This means using the portable mode switch at runtime is not enough to make MT4 start using the terminal dir as it's data dir. It may only do that if it was installed that way. I haven't tested that I'm just going by what it says in the docs.

Jade
969
Jade  
SDC:

Far beit from me to tell you what to do, but I think it is worth considering that if you require clients to use portable mode for the reason you need write access to the terminal dir when the terminal dir is in Program Files, your code could be broken by Windows 8 and probably other future versions of Windows.

If you read information on the MSDN site you will see MS has been telling developers since Vista, that writing to Program Files is a big no no place. They implemented UAC virtualization to provide compatability with older programs but instructed devlopers to assume virtualization is a temporary feature. Therfore assume to not code apps requiring access to protected locations because in future they will get acccess denied with no virtual Program Files to be diverted to.

Case in point being, you can't disable UAC in Windows 8 by simply turning it off like in previous versions. Even though it still has the never notify option in user account settings, it doesnt do the same thing as before. Previously it actually disabled UAC, in Windows 8 UAC is still active. Never notify now means, if an application tries to access protected locations, just dont tell me about it. Application fails. The result of that will be users will think they have turned UAC off and will not be informed they haven't, their apps will just fail to write to files in protected locations.

I believe there are ways to fully disable UAC in Win8 by editing the registry or group policy security settings, the problem with that is the average user is not going to know how or probably wont want to mess with it and they will have got used to leaving UAC alone because modern applications are coded to be UAC compliant, like the new MT4 is.

I found some additional information about this, I think under Windows 8 the user can still do "run as administrator" (if they have access to an adminstrator account). That "should" allow MT4 apps to gain write access to the Program Files dir, but I dont think MT4 itself will use anything but the new data folder structure because the data folder dir is defined during the install, not at runtime so if UAC is enabled, (as is pretty much a given in Win8) The data folder will be the new one.

I think this is something to check: According to the docs, like I just mentioned, the location of the data folder is defined during the install. If the user has UAC turned off when they install MT4 the data folder "should" be defined in the terminal dir. But if UAC is enabled during the install the data folder is created and defined seperately in the appdata dir. This means using the portable mode switch at runtime is not enough to make MT4 start using the terminal dir as it's data dir. It may only do that if it was installed that way. I haven't tested that I'm just going by what it says in the docs.

What I tried in win8.1 with the MT4 build 604: UAC was enabled, installed the MT4. The MT4 used the data folder properly with any UAC settings. If I turned the UAC completely off through Local Policies the same already installed MT4 used the terminal.exe folder as a data folder.

marcelo marques pereira
123
marcelo marques pereira  

Hi !

I am just trying to find "where" can I see my "unused" functions when I compile my source code in the new MQL editor... At moment, the "error tab" does not show them anymore.. Am I missing sth?

Reagards,

Alain Verleyen
39509
Alain Verleyen  
marcelo0:

Hi !

I am just trying to find "where" can I see my "unused" functions when I compile my source code in the new MQL editor... At moment, the "error tab" does not show them anymore.. Am I missing sth?

Reagards,

This warning is no more used.
Ian Venner
2397
Ian Venner  
jade:

What I tried in win8.1 with the MT4 build 604: UAC was enabled, installed the MT4. The MT4 used the data folder properly with any UAC settings. If I turned the UAC completely off through Local Policies the same already installed MT4 used the terminal.exe folder as a data folder.


Really ? I must have got that wrong then too !! The docs describes how the terminal data folder is created during the install based on whether or not UAC is enabled and disabled, it doesnt say that check is made every time MT4 is launched and it doesnt say MT4 will revert to using the Program Files installation folder as the data folder when ever it can !! That is not good practice and contradicts MS documentaion. Applications should never try to write to files in protected locations anymore. That is a basic premise of post Vista Windows.

It also means if a user disables UAC for administrative reasons unrelated to MT4 for a period then turns UAC back on later, MT4 EA's could lose files they saved in the other location. Chart history could be saved in two locations. log files could be split between two locations, the same problem everyone had with UAC virtualization in pre 600 builds. Did you have to reboot Windows when you turned UAC off in local policies ? Did MT4 know how to find its custom indicators and EA's when they were previously in the appdata Data folder while UAC was turned on ?