Цитата 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=Удалить