AtotIK Posted April 1, 2015 Share Posted April 1, 2015 Я не правил остальной код, а только пофиксил то, на что была жалоба. А, понятно. Я просто где-то по теме уже видел пути с Wow6432Node. Решил уже тебе написать, увидят же многие. @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 (edited) Нужно перенести нужный код в отдельную процедуру и вызывать его на этапе ssInstall: [Files] Source: "{app}\res\audio\*.*"; DestDir: "{app}\res_mods\{code:GetModsDirINI}\audio"; Flags: uninsneveruninstall skipifsourcedoesntexist overwritereadonly ignoreversion external; Check: ModsInstallCheck_1; [~Code~] var DirPath, FilePath: AnsiString; function ModsInstallCheck_1(): Boolean; begin Result:=False; DirPath:=ExpandConstant('{app}\res_mods\') + GetModsDir + ExpandConstant('\audio'); If DirExists(DirPath) then FilePath:=ExpandConstant('{app}\res_mods\') + GetModsDir + ExpandConstant('\audio\ingame_voice.fev'); If DirExists(DirPath) and FileExists(FilePath) then begin Result:=True; end; end; procedure CurStepChanged(CurStep: TSetupStep); begin If CurStep=ssInstall then begin ModsInstallCheck_1(); end; Так это не совсем правильно. Тут выполняется функция ModsInstallCheck_1 2 раза. Из секции файлов и из CurStepChanged (второе можно просто убрать). Edited April 1, 2015 by Kotyarko_O 1 @ Quote Link to comment Short link Share on other sites More sharing options...
AtotIK Posted April 1, 2015 Share Posted April 1, 2015 (edited) Так это не совсем правильно. Тут выполняется функция ModsInstallCheck_1 2 раза. Из секции файлов и из CurStepChanged. Ага, в код же не сильно вникал. Можно создать ещё одну булеву функцию с подключением этой и брать уже из неё значение! Upd. Подправил вроде. Даже нет времени всё это проверить. Edited April 1, 2015 by AtotIK 1 @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 Ещё один вопрос. Как вместо Abort прикрутить закрытие инсталлятора? (т.е. если ДА закрывается игра, если НЕТ инсталлятор) Function InitializeSetup1(): Boolean; begin if RunTask('WorldOfTanks.exe', false) then begin if MsgBoxEx(0, 'World of Tanks запущена!', 'Необходимо закрыть мгру!', MB_YESNO or MB_ICONQUESTION, 0, 0) = idYes then begin KillTask('WorldOfTanks.exe'); end else begin Abort; end; @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 Как вместо Abort прикрутить закрытие инсталлятора? В InitializeSetup можно использовать Result := False; @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 В InitializeSetup можно использовать Result := False; Спасибо, но чёто не понял. @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 (edited) Спасибо, но чёто не понял. Function InitializeSetup1(): Boolean; begin if RunTask('WorldOfTanks.exe', false) then begin case MsgBoxEx(0, 'World of Tanks запущена!', 'Необходимо закрыть мгру!', MB_YESNO or MB_ICONQUESTION, 0, 0) of IDYES: begin KillTask('WorldOfTanks.exe'); Result := True; end; INDO: begin Result := False; end; end; end; end; Но работа зависит от того, как устроена основная функция InitializeSetup. Если правильно ею пользоваться - всё будет кул. Универсально будет так: Function InitializeSetup1(): Boolean; begin ... end; Function InitializeSetup2(): Boolean; begin ... end; Function InitializeSetup(): Boolean; begin Result := InitializeSetup1() and InitializeSetup2(); end; Edited April 1, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 (edited) Kotyarko_O не кул! Edited April 1, 2015 by sergey spb @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 @sergey spb, покажи все свои функции InitializeSetup. @ Quote Link to comment Short link Share on other sites More sharing options...
Lesic Posted April 1, 2015 Share Posted April 1, 2015 если знаешь какую-нибудь программу которая может долго записывать видео и при этом вес видео не превысит пары гигов, скинь название или сыль на прогу, буду благодарен и попробую сделать мануал ! uvscreencamera @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 IsTask.rar @sergey spb, покажи все свои функции InitializeSetup. @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 (edited) @sergey spb, ну так в чём проблема? С одной функцией же всё логично-понятнее. Function InitializeSetup1(): Boolean; begin if RunTask('WorldOfTanks.exe', false) then begin case MsgBoxEx(0, 'World of Tanks запущена!', 'Необходимо закрыть мгру!', MB_YESNO or MB_ICONQUESTION, 0, 0) of IDYES: begin KillTask('WorldOfTanks.exe'); Result := True; end; IDNO: begin Result := False; end; end; end; end; Function InitializeSetup(): Boolean; begin Result := InitializeSetup1(); end; Edited April 1, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 @Kotyarko_O, @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 @sergey spb, а сам не догадался исправить? INDO на IDNO поменяй. Исправил пост выше. @ Quote Link to comment Short link Share on other sites More sharing options...
xasic Posted April 1, 2015 Share Posted April 1, 2015 @Kotyarko_O,@AtotIK, Комрады-гуру. Спасибо за советы и помощь. Попробую всё это дело правильно вщемить в инсталлятор. Все-таки для скриптов необходимо сильно развитое правое полушарие, а у меня на этапе begin уже начинает всё путаться))). @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 (edited) @xasic, не зря же мы тут сидим и наводим всех на путь истинный Edited April 1, 2015 by Kotyarko_O 2 @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 @sergey spb, а сам не догадался исправить? INDO на IDNO поменяй. Исправил пост выше. Спасибо, туплю! Вроде всё сделал, но ... если ДА - закрываеться WoT если НЕТ - продолжает работать инсталлятор . @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 1, 2015 Share Posted April 1, 2015 если НЕТ - продолжает работать инсталлятор Значит что-то ещё мешает.Пример, который я дал, не может пропустить. @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted April 1, 2015 Share Posted April 1, 2015 @Kotyarko_O, спасибо, буду мучить!!! @ Quote Link to comment Short link Share on other sites More sharing options...
-zav- Posted April 1, 2015 Share Posted April 1, 2015 uvscreencamera лучше через 1,5 года чем никогда @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.