Имя пользователя:
Пароль:
 

Показать сообщение отдельно

SHVtYW4=


Сообщения: 3451
Благодарности: 1273

Профиль | Отправить PM | Цитировать


Цитата Raz3r:
Unknown custome message name »
Ну правильно. Ругается на то, что отсутствует CustomMessages.
Вот готовый вариант:
Код: Выделить весь код
[CustomMessages]
DelSetUser=Удалить все пользовательские настройки программы?
DelSetServer=Удалить все файлы сервера?

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox(CustomMessage('DelSetUser'), mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\config'), True, True, True);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox(CustomMessage('DelSetServer'), mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\files'), True, True, True);
 DeleteFile(ExpandConstant('{app}\ts3server.sqlitedb'));
end;
end;
в данном скрипте обрати внимание на то, что изменилось в MsgBox.

Если же хочешь прописывать в MsgBox текст, то удали то, что отметил красным:
Код: Выделить весь код
[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox(CustomMessage('Удалить все пользовательские настройки программы?'), mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\config'), True, True, True);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox(CustomMessage('Удалить все файлы сервера?'), mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\files'), True, True, True);
 DeleteFile(ExpandConstant('{app}\ts3server.sqlitedb'));
end;
end;
т.е должно получиться так:
Код: Выделить весь код
[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox('Удалить все пользовательские настройки программы?', mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\config'), True, True, True);
begin
 if (CurUninstallStep = usUninstall) and
 (MsgBox('Удалить все файлы сервера?', mbInformation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then
 DelTree(ExpandConstant('{app}\files'), True, True, True);
 DeleteFile(ExpandConstant('{app}\ts3server.sqlitedb'));
end;
end;

Кстати, использование [CustomMessages], позволяет задавать сообщения на других языках, например:
Код: Выделить весь код
[Languages]
Name: en; MessagesFile: compiler:Default.isl
Name: ru; MessagesFile: compiler:Languages\Russian.isl

[CustomMessages]
en.add=Add
en.del=Delete
ru.add=Добавить
ru.del=Удалить

Отправлено: 23:28, 31-03-2014 | #189