Старожил
Сообщения: 398
Благодарности: 21
|
Профиль
|
Отправить PM
| Цитировать
Ктонить может подкрутить скрипт, чтоб та часть что касается возврата оригинальных файлов, запускалась только если выбран компонент "Game\Lokal\Backup", а та часть что отвечает за проверку на оставшыеся файлы, если выбран "Game\Full"?
читать дальше »
Код: ![Выделить весь код](images/misc/selectcode.png)
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
Res: Integer;
//Возврат оригинальных файлов
begin
if CurUninstallStep = usPostUninstall then
begin
MoveDir(ExpandConstant('{app}\Backup\'),ExpandConstant('{app}'));
RemoveDir(ExpandConstant('{app}\Backup\'));
end;
//Проверка на оставшыеся файлы
begin
case CurUninstallStep of
usPostUninstall:
begin
if DirExists(ExpandConstant('{app}')) then
if ExpandConstant('{language}') = 'ua' then
case MsgBox('Папка "' + ExpandConstant('{app}') + '" не порожня.'#13#13 +
'"Так" – повне видалення всіх файлів у папці, включаючи саму папку.' #13#13 +
'"Ні" – відкрити папку в провіднику, щоб вручну видалити файли.'#13#13 +
'"Скасувати" – нічого не робити, видалити папку пізніше самостійно.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Папка не видалена.' #13#13 'Папка або один з файлів у ній задіяні іншою програмою.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Помилка відкриття.' #13#13 'Папка не знайдена.', mbError, MB_OK);
IDCANCEL:;
end
else
if ExpandConstant('{language}') = 'ru' then
case MsgBox('Папка "' + ExpandConstant('{app}') + '" не пуста.'#13#13 +
'"Да" – полное удаление всех файлов в папке, включая саму папку.' #13#13 +
'"Нет" – открыть папку в проводнике, чтобы вручную удалить файлы.'#13#13 +
'"Отмена" – ничего не делать, удалить папку позже самостоятельно.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Папка не удалена.' #13#13 'Папка или один из файлов в ней задействованы другим приложением.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Ошибка открытия.' #13#13 'Папка не найдена.', mbError, MB_OK);
IDCANCEL:;
end
else
case MsgBox('Directory "' + ExpandConstant('{app}') + '" is not empty.'#13#13 +
'"Yes" to delete all of the files in the directory, including the directory itself.' #13#13 +
'"No" to open the directory with explorer to delete the files manually.'#13#13 +
'"Cancel" to do nothing and delete the directory later manually.', mbInformation, MB_YESNOCANCEL) of
IDYES:
if not DelTree(ExpandConstant('{app}'), True, True, True) then
MsgBox('Directory is not deleted.' #13#13 'Directory or one of the files are used by the other application.', mbError, MB_OK);
IDNO:
if not ShellExec('open', ExpandConstant('{app}'), '', '', SW_SHOWMAXIMIZED, ewNoWait, Res) then
MsgBox('Error opening the directory.' #13#13 'Directory is not found.', mbError, MB_OK);
IDCANCEL:;
end
end
end
end;
end;
|