Инструменты пользователя

Инструменты сайта


en:autorun:documentation:config_update_3x

Switching to version 3.x

In general, compatibility with old configuration files is preserved, but some changes in the new version may cause inoperability or inconveniences:

  1. Unquoted strings in conditions and expressions are now not allowed by default.
  2. Removed AutorunBlockUnload command.
  3. Removed old syntax FileExists in conditions.
  4. Removed AutorunAllowWriteEnv directive.
  5. Fixed a typo in the name of the AutorunLoadInSubprocess directive.
  6. Changed default translation language.
  7. Изменён вывод команды FileExist.

How to upgrade to the new version

1. Unquoted strings in conditions and expressions are now not allowed by default.

It is recommended that you read the Types of syntax section to understand the differences between two kinds of syntax in Autorun and why they exist.

You can simply include directive LegacyExpressions, but it is recommended that you make changes to support the current behavior.

Any problems that occur when using the new features with the LegacyExpressions directive enabled, but do not occur without it, will be not considered as a bug and will not be fixed.

Now it is required that all strings in expressions (including calculated strings) be in double quotes or single quotes.

Some examples:

# Prior:
if %MYVAR% = text then
# Now:
if MYVAR = "text" then  
# or
if %MYVAR% = "text" then
 
# Prior:
if not FileExist(%COMMANDER_PATH%\NoClose.exe) then
# Now:
if not FileExist("%COMMANDER_PATH%\NoClose.exe") then
# or
if not FileExist(%COMMANDER_PATH% & "\NoClose.exe") then
 
# Prior:
if IniRead(%COMMANDER_INI%, Configuration, LanguageIni) then
# Now:
if IniRead(%COMMANDER_INI%, "Configuration", "LanguageIni") then
# or
if IniRead(%COMMANDER_INI%, 'Configuration', 'LanguageIni') then
 
# Prior:
%"IniRead(%COMMANDER_INI%, Configuration, LanguageIni)"
# Now:
%"IniRead(%COMMANDER_INI%, 'Configuration', 'LanguageIni')"
# or
%'IniRead(%COMMANDER_INI%, "Configuration", "LanguageIni")'

2. Removed AutorunBlockUnload command

The following changes need to be made:

# Prior:
AutorunBlockUnload(Yes)
 
# Now:
Pragma AutorunBlockUnload

3. Removed command syntax FileExist/ProcessExist in conditions.

The following changes need to be made:

# Prior:
If FileExist "file" Then
 
# Now:
If FileExist("file") Then

4. Removed AutorunAllowWriteEnv directive

Unfortunately, there is no other option but to rewrite the code or use the old version. The operation of this directive is not applicable in the new version.

5. Fixed typo in AutorunLoadInSubprocess directive name

The following changes need to be made:

# Prior:
Pragma AutorunLoadInSubrocess
 
# Now:
Pragma AutorunLoadInSubprocess

6. Changed default translation language

Previously, in the absence of the AutorunLanguage directive, English message strings were loaded, now loading strings in the language set in Total Commander. If you are not satisfied with this behavior, you can add the first line to the script:

Pragma AutorunLanguage ENG

7. Изменён вывод команды FileExist.

Вывод команды FileExist теперь зависит от типа переданного пути. Проблема может возникнуть только в случае, если вы проверяли вывод явно. Такой код не сработает, если в него передать каталог:

if FileExist(...) = 1 then

Если нет необходимости определения, файл передан или каталог, можно переписать код так:

if FileExist(...) > 0 then
# или
if FileExist(...) then
en/autorun/documentation/config_update_3x.txt · Последнее изменение: 2023/05/07 00:00 — loopback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki