P.S.Enot Posted January 22, 2022 Share Posted January 22, 2022 Здравствуйте парни. Подскажите пожалуйста код, который определяет о не соответствии версии игры и модпака, и запрещает дальнейшую установку или процедуру установщика ??? Вот типа как на скриншоте @ Quote Link to comment Short link Share on other sites More sharing options...
Xotabych Posted January 22, 2022 Share Posted January 22, 2022 @P.S.Enot ты уже не первый год тут трешься на форуме, тебе разжевать и положить в рот нужно. Поиск рулит в теме- тут все есть. @ Quote Link to comment Short link Share on other sites More sharing options...
P.S.Enot Posted January 22, 2022 Share Posted January 22, 2022 (edited) 5 минут назад, Xotabych сказал: @P.S.Enot ты уже не первый год тут трешься на форуме, тебе разжевать и положить в рот нужно. Поиск рулит в теме- тут все есть. не че мне ненужно разжёвывать. просто попросил скинуть код. вот и все . не думаю что сложно кто знает тыкнуть или на страницу нужную или просто про копировать. Кому нужно тема ТУТ или вот архив с документом проверка версии клиента игры.rar Edited January 22, 2022 by P.S.Enot @ Quote Link to comment Short link Share on other sites More sharing options...
Nowik1971 Posted January 23, 2022 Share Posted January 23, 2022 (edited) 22.01.2022 в 15:33, P.S.Enot сказал: Здравствуйте парни. Подскажите пожалуйста код, который определяет о не соответствии версии игры и модпака, и запрещает дальнейшую установку или процедуру установщика ??? Вот типа как на скриншоте Вот код с этой темы раз не можешь или ленишься найти!!! #define GameName "Sacred" #define modpack_versionInfo "0.9.15" [Setup] AppName={#GameName} AppVerName={#GameName} DefaultDirName={pf}\{#GameName} AppPublisher=troyan [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] russian.Modpack=Модпак russian.SupportForum=Тема на koreanrandom.com russian.ForumLink=http://сайт.ru/updater russian.UpdatedLabel=Обновлено: russian.WOT_version=Версия WOT: russian.modpack_version=Версия модпака: russian.installer_version=wotunion installer russian.CheckingActualModpackVersionLabel=Проверка обновлений модпака... russian.CannotCheckUpdate=Ошибка при проверке обновлений. Далее - для установки russian.NoUpdates=Обновлений не найдено. Далее - для установки russian.ErrorWhileOpeningUpdatePage=Ошибка при переходе на страницу загрузки russian.AllIsReadyForInstall=Все готово для установки. Нажмите Далее для продолжения russian.UpdateFound=найдено russian.httpVersion=http://сайт.ru/updater/version.txt russian.httpMsg=http://сайт.ru/updater/msg.txt russian.WOT_NotFound=Клиент World of Tanks не обнаружен. Установка будет прервана. russian.for=для russian.CheckAccess=Установка невозможна. Проверьте наличие прав доступа к файлам и папкам установленного клиента World of Tanks, закройте программы, которые используют папки и/или файли клиента World of Tanks, или запустите инсталлятор модпака с правами администратора. russian.MustUninstallBefore=Установка невозможна. Воспользуйтесь деинсталлятором модпака для удаления предыдущей установки модпака (Пуск - Программы - wotunion modpack - Удалить wotunion modpack). russian.NewVersionFound=Доступна новая версия модпака: russian.GoToLink=Перейти по ссылке в браузере для загрузки ? russian.CheckAccessUninstall=Деинсталляция невозможна. Проверьте наличие прав доступа к файлам и папкам установленного клиента World of Tanks закройте программы, которые используют папки и/или файлы клиента World of Tanks, или запустите деинсталлятор модпака с правами администратора. [Code] var CheckingActualModpackVersionLabel: TLabel; WelcomePageID: Integer; ActualVersion: String; ActualVersionLongint: Longint; InstallVersionLongint: Longint; ActualVersionMsg: String; ReadyToInstall: Boolean; TerminateInstall: Boolean; function DownloadFile(const AURL: string; var AResponse: string): Boolean; var WinHttpRequest: Variant; begin Result := False; try WinHttpRequest := CreateOleObject('WinHttp.WinHttpRequest.5.1'); WinHttpRequest.Open('GET', AURL, False); WinHttpRequest.Send; AResponse := WinHttpRequest.ResponseText; Case WinHttpRequest.Status of '200': begin Result := True; end; end; except ReadyToInstall:=True; AResponse := GetExceptionMessage; CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:CannotCheckUpdate}'); Result := False; end; end; procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpSelectDir then begin end; WizardForm.InnerNotebook.Visible := CurPageID <> WelcomePageID; end; function Form_CreatePage(PreviousPageId: Integer): Integer; var Page: TWizardPage; begin Page := CreateCustomPage(PreviousPageId, '', ''); WelcomePageID := Page.ID; CheckingActualModpackVersionLabel := TLabel.Create(WizardForm); with CheckingActualModpackVersionLabel do begin Parent := WizardForm.InnerPage; Visible:=True; Left := ScaleX(5); Top := ScaleY(292); Font.Color:= clBlack; end; Result := Page.ID; end; Procedure ForumLinkOnClick (Sender: TObject); var ErrorCode: Integer; Begin ShellExec ('open', ExpandConstant('{cm:ForumLink}'),'','', SW_SHOWNORMAL, ewNoWait, ErrorCode); end; procedure InitializeWizard(); begin Form_CreatePage(wpWelcome); with WizardForm.PageDescriptionLabel do begin Visible := False; end; with WizardForm.PageNameLabel do begin Visible := False; end; end; function CheckUpdates():Boolean; var ErrorCode: Integer; begin if ReadyToInstall=False then begin CheckingActualModpackVersionLabel.Visible:=True; CheckingActualModpackVersionLabel.Caption := ExpandConstant('{cm:CheckingActualModpackVersionLabel}'); if ((DownloadFile(ExpandConstant('{cm:httpVersion}'), ActualVersion)=True) and (DownloadFile(ExpandConstant('{cm:httpMsg}'), ActualVersionMsg)=True)) then begin if (StrToIntDef(ActualVersion, ActualVersionLongint)) > (StrToIntDef('{#modpack_versionInfo}', InstallVersionLongint)) then begin CheckingActualModpackVersionLabel.Caption := CheckingActualModpackVersionLabel.Caption + ExpandConstant('{cm:UpdateFound}'); if MsgBox(ExpandConstant('{cm:NewVersionFound}') + ActualVersionMsg + ExpandConstant('{cm:GoToLink}'), mbConfirmation, MB_YESNO) = IDYES then begin If not ShellExec('', ExpandConstant('{cm:ForumLink}'), '', '', SW_SHOW, ewNoWait, ErrorCode) then begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:ErrorWhileOpeningUpdatePage}'); ReadyToInstall:=True; Result:=False; end else begin Result:=False; TerminateInstall:=True; WizardForm.Close; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:AllIsReadyForInstall}'); ReadyToInstall:=True; Result:=False; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:NoUpdates}'); ReadyToInstall:=True; Result:=False; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:CannotCheckUpdate}'); ReadyToInstall:=True; Result:=False; end; end else begin Result:=True; end; end; function NextButtonClick(CurPageID: Integer): Boolean; begin if CurPageID <> WelcomePageID then begin Result:=True; end else begin Result:=CheckUpdates; end; end; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin if ((CurPageID=WelcomePageID) and (TerminateInstall=True)) then Confirm := False; end; или вот!!! [Code] function FileVersion(const FilePath: String): String; var oFS: Variant; begin oFS:= CreateOleObject('Scripting.FileSystemObject'); try Result:= oFS.GetFileVersion(FilePath); except end; end; //"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""// Function NextButtonClick(CurPageID: Integer): Boolean; begin Result := True; case CurPageID of wpSelectDir: begin if FileExists(ExpandConstant('{app}')+'win32\WorldOfTanks.exe') then begin if FileVersion(ExpandConstant('{app}')+'win32\WorldOfTanks.exe') < '{#patch}' then begin MsgBoxEx(WizardForm.Handle, 'Моды не будут работать на данной версии патча игры! Моды предназначены для версии патча {#patch}', 'Моды не подходят к данному патчу World of Tanks', MB_OK or MB_ICONWARNING, 0, 0); Result:= false; end; end; end; end; end; Коды конечно немного устарели, но как образец и для размышления пойдут!!! Подправишь... Edited January 23, 2022 by Nowik1971 Дополнение 1 @ Quote Link to comment Short link Share on other sites More sharing options...
P.S.Enot Posted January 23, 2022 Share Posted January 23, 2022 37 минут назад, Nowik1971 сказал: Вот код с этой темы раз не можешь или ленишься найти!!! #define GameName "Sacred" #define modpack_versionInfo "0.9.15" [Setup] AppName={#GameName} AppVerName={#GameName} DefaultDirName={pf}\{#GameName} AppPublisher=troyan [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] russian.Modpack=Модпак russian.SupportForum=Тема на koreanrandom.com russian.ForumLink=http://сайт.ru/updater russian.UpdatedLabel=Обновлено: russian.WOT_version=Версия WOT: russian.modpack_version=Версия модпака: russian.installer_version=wotunion installer russian.CheckingActualModpackVersionLabel=Проверка обновлений модпака... russian.CannotCheckUpdate=Ошибка при проверке обновлений. Далее - для установки russian.NoUpdates=Обновлений не найдено. Далее - для установки russian.ErrorWhileOpeningUpdatePage=Ошибка при переходе на страницу загрузки russian.AllIsReadyForInstall=Все готово для установки. Нажмите Далее для продолжения russian.UpdateFound=найдено russian.httpVersion=http://сайт.ru/updater/version.txt russian.httpMsg=http://сайт.ru/updater/msg.txt russian.WOT_NotFound=Клиент World of Tanks не обнаружен. Установка будет прервана. russian.for=для russian.CheckAccess=Установка невозможна. Проверьте наличие прав доступа к файлам и папкам установленного клиента World of Tanks, закройте программы, которые используют папки и/или файли клиента World of Tanks, или запустите инсталлятор модпака с правами администратора. russian.MustUninstallBefore=Установка невозможна. Воспользуйтесь деинсталлятором модпака для удаления предыдущей установки модпака (Пуск - Программы - wotunion modpack - Удалить wotunion modpack). russian.NewVersionFound=Доступна новая версия модпака: russian.GoToLink=Перейти по ссылке в браузере для загрузки ? russian.CheckAccessUninstall=Деинсталляция невозможна. Проверьте наличие прав доступа к файлам и папкам установленного клиента World of Tanks закройте программы, которые используют папки и/или файлы клиента World of Tanks, или запустите деинсталлятор модпака с правами администратора. [Code] var CheckingActualModpackVersionLabel: TLabel; WelcomePageID: Integer; ActualVersion: String; ActualVersionLongint: Longint; InstallVersionLongint: Longint; ActualVersionMsg: String; ReadyToInstall: Boolean; TerminateInstall: Boolean; function DownloadFile(const AURL: string; var AResponse: string): Boolean; var WinHttpRequest: Variant; begin Result := False; try WinHttpRequest := CreateOleObject('WinHttp.WinHttpRequest.5.1'); WinHttpRequest.Open('GET', AURL, False); WinHttpRequest.Send; AResponse := WinHttpRequest.ResponseText; Case WinHttpRequest.Status of '200': begin Result := True; end; end; except ReadyToInstall:=True; AResponse := GetExceptionMessage; CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:CannotCheckUpdate}'); Result := False; end; end; procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpSelectDir then begin end; WizardForm.InnerNotebook.Visible := CurPageID <> WelcomePageID; end; function Form_CreatePage(PreviousPageId: Integer): Integer; var Page: TWizardPage; begin Page := CreateCustomPage(PreviousPageId, '', ''); WelcomePageID := Page.ID; CheckingActualModpackVersionLabel := TLabel.Create(WizardForm); with CheckingActualModpackVersionLabel do begin Parent := WizardForm.InnerPage; Visible:=True; Left := ScaleX(5); Top := ScaleY(292); Font.Color:= clBlack; end; Result := Page.ID; end; Procedure ForumLinkOnClick (Sender: TObject); var ErrorCode: Integer; Begin ShellExec ('open', ExpandConstant('{cm:ForumLink}'),'','', SW_SHOWNORMAL, ewNoWait, ErrorCode); end; procedure InitializeWizard(); begin Form_CreatePage(wpWelcome); with WizardForm.PageDescriptionLabel do begin Visible := False; end; with WizardForm.PageNameLabel do begin Visible := False; end; end; function CheckUpdates():Boolean; var ErrorCode: Integer; begin if ReadyToInstall=False then begin CheckingActualModpackVersionLabel.Visible:=True; CheckingActualModpackVersionLabel.Caption := ExpandConstant('{cm:CheckingActualModpackVersionLabel}'); if ((DownloadFile(ExpandConstant('{cm:httpVersion}'), ActualVersion)=True) and (DownloadFile(ExpandConstant('{cm:httpMsg}'), ActualVersionMsg)=True)) then begin if (StrToIntDef(ActualVersion, ActualVersionLongint)) > (StrToIntDef('{#modpack_versionInfo}', InstallVersionLongint)) then begin CheckingActualModpackVersionLabel.Caption := CheckingActualModpackVersionLabel.Caption + ExpandConstant('{cm:UpdateFound}'); if MsgBox(ExpandConstant('{cm:NewVersionFound}') + ActualVersionMsg + ExpandConstant('{cm:GoToLink}'), mbConfirmation, MB_YESNO) = IDYES then begin If not ShellExec('', ExpandConstant('{cm:ForumLink}'), '', '', SW_SHOW, ewNoWait, ErrorCode) then begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:ErrorWhileOpeningUpdatePage}'); ReadyToInstall:=True; Result:=False; end else begin Result:=False; TerminateInstall:=True; WizardForm.Close; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:AllIsReadyForInstall}'); ReadyToInstall:=True; Result:=False; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:NoUpdates}'); ReadyToInstall:=True; Result:=False; end; end else begin CheckingActualModpackVersionLabel.Caption:=ExpandConstant('{cm:CannotCheckUpdate}'); ReadyToInstall:=True; Result:=False; end; end else begin Result:=True; end; end; function NextButtonClick(CurPageID: Integer): Boolean; begin if CurPageID <> WelcomePageID then begin Result:=True; end else begin Result:=CheckUpdates; end; end; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin if ((CurPageID=WelcomePageID) and (TerminateInstall=True)) then Confirm := False; end; или вот!!! [Code] function FileVersion(const FilePath: String): String; var oFS: Variant; begin oFS:= CreateOleObject('Scripting.FileSystemObject'); try Result:= oFS.GetFileVersion(FilePath); except end; end; //"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""// Function NextButtonClick(CurPageID: Integer): Boolean; begin Result := True; case CurPageID of wpSelectDir: begin if FileExists(ExpandConstant('{app}')+'win32\WorldOfTanks.exe') then begin if FileVersion(ExpandConstant('{app}')+'win32\WorldOfTanks.exe') < '{#patch}' then begin MsgBoxEx(WizardForm.Handle, 'Моды не будут работать на данной версии патча игры! Моды предназначены для версии патча {#patch}', 'Моды не подходят к данному патчу World of Tanks', MB_OK or MB_ICONWARNING, 0, 0); Result:= false; end; end; end; end; end; Коды конечно немного устарели, но как образец и для размышления пойдут!!! Подправишь... Спасибо . вчера нашел уже, выше тоже вариант рабочий выложи. но за помощь большое спасибо @ Quote Link to comment Short link Share on other sites More sharing options...
P.S.Enot Posted February 2, 2022 Share Posted February 2, 2022 (edited) Доброго времени суток всем. Собрал бекап, удаление и тд. Но по чему то на вот такие функции function BackupCheck_1(): Boolean; function BackupCheck_2(): Boolean; function BackupCheck_3(): Boolean; function BackupCheck_4(): Boolean; пишет варнинги. типо какие то предупреждения . кто может подскажет с чем это связано? Скрипт использую этот BackUpPage.iss 2 часа назад, P.S.Enot сказал: Доброго времени суток всем. Собрал бекап, удаление и тд. Но по чему то на вот такие функции function BackupCheck_1(): Boolean; function BackupCheck_2(): Boolean; function BackupCheck_3(): Boolean; function BackupCheck_4(): Boolean; пишет варнинги. типо какие то предупреждения . кто может подскажет с чем это связано? Скрипт использую этот BackUpPage.iss Пожалуй сам себе отвечу, может кому то пригодится. Просто в функциях нужно было дописать Result:= True; так же рабочий вариант прилагаю BackUpPage.iss Edited February 2, 2022 by P.S.Enot @ Quote Link to comment Short link Share on other sites More sharing options...
P.S.Enot Posted February 9, 2022 Share Posted February 9, 2022 (edited) Всем доброго времени суток. ребята помогите сделать еще две кнопки ссылками на социальные профили. типа вк и канал ютуб . вот код но я не понял как в него встроить еще две иконки сделать их кликабельными с переходом на группу вк и канал ютуб. Кому не сложно помогите пожалуйста . За ранее благодарю . вот мой код кнопка ссылкой.txt Сам себе походу опять и отвечу. Вот так вот слепил вариант. короче код не придумал Две Кнопки Social.txt картинки не забываем добавить и указать к ним путь. Вариант без Botva2 Edited February 9, 2022 by P.S.Enot @ Quote Link to comment Short link Share on other sites More sharing options...
hevi Posted March 1, 2022 Share Posted March 1, 2022 09.02.2022 в 14:26, P.S.Enot сказал: Всем доброго времени суток. ребята помогите сделать еще две кнопки ссылками на социальные профили. типа вк и канал ютуб . вот код но я не понял как в него встроить еще две иконки сделать их кликабельными с переходом на группу вк и канал ютуб. Кому не сложно помогите пожалуйста . За ранее благодарю . вот мой код кнопка ссылкой.txt Сам себе походу опять и отвечу. Вот так вот слепил вариант. короче код не придумал Две Кнопки Social.txt картинки не забываем добавить и указать к ним путь. Вариант без Botva2 Афигеть ты пролистал все страницы и нашёл что тебе нужно))))) @ Quote Link to comment Short link Share on other sites More sharing options...
P.S.Enot Posted March 1, 2022 Share Posted March 1, 2022 4 часа назад, hevi сказал: Афигеть ты пролистал все страницы и нашёл что тебе нужно))))) нет не угадал @ Quote Link to comment Short link Share on other sites More sharing options...
DraugDM Posted June 4, 2022 Share Posted June 4, 2022 (edited) Друзья, плиз подскажите как убрать это драное окошко?((( через раз выскакивает( Цитата '1.Мультиклиент.': UndefPic := 'MK.bmp'; else begin LastIndex := UNDEF_INDEX; PicForm.Hide(); ImgApplyChanges(PicForm.Handle); Exit; end; end; if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic); ShowPicHint(TempPath + UndefPic); finally LastIndex := Index; end; end; procedure CompOnMouseLeave(Sender: TObject); begin ImgRelease(InfoPic); PicForm.Hide; ImgApplyChanges(PicForm.Handle); LastIndex := -1; end; procedure InitInfo(); begin WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove; WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave; TempPath := AddBackslash(ExpandConstant('{tmp}')); LastIndex := UNDEF_INDEX; PicForm := TForm.Create(WizardForm) with PicForm do begin BorderStyle := bsNone; FormStyle := fsStayOnTop; end; SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED); SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA); end; procedure InitializeWizard1(); begin InitInfo(); end; function NextButtonclick(CurPageID: Integer): Boolean; begin Result := True; case CurPageID of wpSelectDir: if not FileExists(ExpandConstant('{app}\WorldOfTanks.exe')) then begin MsgBox('Не верно указана папка World of Tanks!', mbError, MB_OK); Result := False; end; end; end; #define WotVersion "1.17.0.0" var DeleteRadioButton, NoneRadioButton: TRadioButton; DeleteCashAndLogsCheckBox, DeleteUpdatesCheckBox: TCheckBox; function BackupCheck_1(): Boolean; var DeleteDescLabel, MoveDescLabel, NoneDescLabel: TLabel; begin DeleteRadioButton:=TRadioButton.Create(WizardForm); DeleteRadioButton.SetBounds(0, 120, WizardForm.RunList.Width, 20) DeleteRadioButton.Checked:=True; DeleteRadioButton.Caption:=ExpandConstant('{cm:delete}'); DeleteRadioButton.Parent:=WizardForm.SelectDirPage; DeleteDescLabel:=TLabel.Create(WizardForm); DeleteDescLabel.Parent:=WizardForm.SelectDirPage; DeleteDescLabel.Left:=0; DeleteDescLabel.Top:=DeleteRadioButton.Top + DeleteRadioButton.Height; DeleteDescLabel.Width:=WizardForm.SelectDirPage; DeleteDescLabel.Height:=20; DeleteDescLabel.AutoSize:=False; DeleteDescLabel.Wordwrap:=True; NoneRadioButton:=TRadioButton.Create(WizardForm); NoneRadioButton.SetBounds(0, 150, WizardForm.RunList.Width, 20) NoneRadioButton.Checked:=False; NoneRadioButton.Caption:=ExpandConstant('{cm:delete2}'); NoneRadioButton.Parent:=WizardForm.SelectDirPage; NoneDescLabel:=TLabel.Create(WizardForm); NoneDescLabel.Parent:=WizardForm.SelectDirPage; NoneDescLabel.Left:=0; NoneDescLabel.Top:=NoneRadioButton.Top + NoneRadioButton.Height; NoneDescLabel.Width:=WizardForm.SelectDirPage; NoneDescLabel.Height:=20; NoneDescLabel.AutoSize:=False; NoneDescLabel.Wordwrap:=True; DeleteCashAndLogsCheckBox:=TCheckBox.Create(WizardForm); DeleteCashAndLogsCheckBox.SetBounds(0, 180, WizardForm.RunList.Width, 20) DeleteCashAndLogsCheckBox.Checked:=True; DeleteCashAndLogsCheckBox.Caption:=ExpandConstant('{cm:delete3}'); DeleteCashAndLogsCheckBox.Parent:=WizardForm.SelectDirPage; DeleteUpdatesCheckBox:=TCheckBox.Create(WizardForm); DeleteUpdatesCheckBox.SetBounds(180, 180, WizardForm.RunList.Width, 20) DeleteUpdatesCheckBox.Checked:=True; DeleteUpdatesCheckBox.Caption:=ExpandConstant('{cm:delete4}'); DeleteUpdatesCheckBox.Parent:=WizardForm.SelectDirPage; end; function BackupCheck_2(): Boolean; begin If DeleteRadioButton.Checked then begin DelTree(ExpandConstant('{app}\res_mods\{#WotVersion}'), True, True, True); DelTree(ExpandConstant('{app}\mods\{#WotVersion}'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\mods\logs'), True, True, True); DelTree(ExpandConstant('{app}\mods\resources'), True, True, True); DelTree(ExpandConstant('{app}\mods\temp'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\1.16.1.0'), True, True, True); DelTree(ExpandConstant('{app}\mods\1.16.1.0'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\mem_helper64.pyd')); DeleteFile(ExpandConstant('{app}\res_mods\mem_helper.pyd')); CreateDir(ExpandConstant('{app}\res_mods\{#WotVersion}')); CreateDir(ExpandConstant('{app}\mods\{#WotVersion}')); end; end; function BackupCheck_3(): Boolean; begin If DeleteCashAndLogsCheckBox.Checked then begin DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\account_caches\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\awesomium_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\battle_results\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\battlehits\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\clan_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\custom_data\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\dossier_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\messenger_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\tutorial_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\veh_cmp_cache\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\profile\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\pmod\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\wgfm\'), True, True, True); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\ekspoint\'), True, True, True); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\modsettings.dat')); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\accounts.manager')); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\wn8.json')); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\wn8scales.json')); DelTree(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\xvm\'), True, True, True); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\modsettings.dat')); DeleteFile(ExpandConstant('{userappdata}\wargaming.net\WorldOfTanks\*.dat')); DelTree(ExpandConstant('{app}\replays\replays_manager\'), True, True, True); DelTree(ExpandConstant('{app}\logs'), True, True, True); DelTree(ExpandConstant('{app}\Reports'), True, True, True); DelTree(ExpandConstant('{app}\replays'), True, True, True); DelTree(ExpandConstant('{app}\profile'), True, True, True); DeleteFile(ExpandConstant('{app}\python.log')); DeleteFile(ExpandConstant('{app}\xvm.log')); DeleteFile(ExpandConstant('{app}\versus.log')); DeleteFile(ExpandConstant('{app}\SaveLastServer.dat')); DeleteFile(ExpandConstant('{app}\WGStream.log')); DeleteFile(ExpandConstant('{app}\WGSocial.log')); end; end; function BackupCheck_4(): Boolean; begin If DeleteUpdatesCheckBox.Checked then begin DelTree(ExpandConstant('{app}\Updates'), True, True, True); DelTree(ExpandConstant('{app}\UpdatesData'), True, True, True); end; end; procedure CurStepChanged(CurStep: TSetupStep); begin if CurStep = ssInstall then begin BackupCheck_2(); BackupCheck_3(); BackupCheck_4(); end; end; procedure InitializeWizard2(); begin BackupCheck_1(); end; procedure InitializeWizard3(); begin ExtractTemporaryFile('BASS.dll'); ExtractTemporaryFile('CallbackCtrl.dll'); ExtractTemporaryFile('botva2.dll'); ExtractTemporaryFile('MusicButton.png'); ExtractTemporaryFile('Music.mp3'); BASS_Init('{tmp}\Music.mp3') BASS_CreateOnOffButton(WizardForm, '{tmp}\MusicButton.png', 20, 320, 36, 36, 4) end; procedure AutorsSiteClick(hBtn: HWND); var ErrorCode: Integer; begin ShellExec('open', '{#AutorsSiteUrl}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode); end; procedure InitializeWizard4(); var AutorsSite: HWND; begin ExtractTemporaryFile('AutorsLogo.png'); AutorsSite:=BtnCreate(WizardForm.Handle, ScaleX(75), ScaleY(320), ScaleX(100), ScaleY(36), ExpandConstant('{tmp}\AutorsLogo.png'), 4, false); BtnSetEvent(AutorsSite, BtnClickEventID, WrapBtnCallback(@AutorsSiteClick,1)); BtnSetVisibility(AutorsSite, True); end; procedure InitializeWizard(); begin InitializeWizard1(); InitializeWizard2(); InitializeWizard3(); InitializeWizard4(); end; procedure DeinitializeSetup(); begin BASS_DeInit; gdipShutdown end; Edited June 5, 2022 by DraugDM @ Quote Link to comment Short link Share on other sites More sharing options...
hevi Posted June 6, 2022 Share Posted June 6, 2022 (edited) 04.06.2022 в 23:44, DraugDM сказал: Друзья, плиз подскажите как убрать это драное окошко?((( через раз выскакивает( А ты пробовал в некоторых строчках ставить точку с запятой (;;;;;;;;;;;;;) PicForm := TForm.Create(WizardForm) DeleteRadioButton.SetBounds(0, 120, WizardForm.RunList.Width, 20) NoneRadioButton.SetBounds(0, 150, WizardForm.RunList.Width, 20) BASS_Init('{tmp}\Music.mp3') BASS_CreateOnOffButton(WizardForm, '{tmp}\MusicButton.png', 20, 320, 36, 36, 4) gdipShutdown Edited June 6, 2022 by hevi @ Quote Link to comment Short link Share on other sites More sharing options...
DraugDM Posted June 7, 2022 Share Posted June 7, 2022 06.06.2022 в 07:08, hevi сказал: А ты пробовал в некоторых строчках ставить точку с запятой (;;;;;;;;;;;;;) PicForm := TForm.Create(WizardForm) DeleteRadioButton.SetBounds(0, 120, WizardForm.RunList.Width, 20) NoneRadioButton.SetBounds(0, 150, WizardForm.RunList.Width, 20) BASS_Init('{tmp}\Music.mp3') BASS_CreateOnOffButton(WizardForm, '{tmp}\MusicButton.png', 20, 320, 36, 36, 4) gdipShutdown спс дружище!!! @ Quote Link to comment Short link Share on other sites More sharing options...
hevi Posted July 3, 2022 Share Posted July 3, 2022 (edited) 3 минуты назад, hevi сказал: [Setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf}\My Application OutputDir=. [Tasks] Name: task1; Description: Доп. программное обеспечение; Flags: exclusive Name: task1\task2; Description: DirectX; Flags: unchecked Name: task1\task3; Description: Microsoft Visual C++ 2005 Redist; Flags: unchecked var CheckListBox: TNewCheckListBox; procedure InitializeWizard(); begin CheckListBox := TNewCheckListBox.Create(WizardForm); with CheckListBox do begin Parent := WizardForm.SelectTasksPage; SetBounds(WizardForm.TasksList.Left, WizardForm.TasksList.Top+ScaleY(80), WizardForm.TasksList.Width, ScaleY(80)); AddCheckBoxEx('Язык интерфейса:', '', 0, False, False, True, False, nil, True); AddRadioButtonEx('Русский', '', 1, True, True, nil, False); AddRadioButtonEx('Английский', '', 1, True, True, nil, True); Color:= clWindow; ParentColor:= True; WantTabs:= True; BorderStyle:= bsNone; ItemHeightFixed := True; HideSelection := True; end; end; Edited July 3, 2022 by hevi @ Quote Link to comment Short link Share on other sites More sharing options...
F1nder Posted September 5, 2022 Share Posted September 5, 2022 (edited) Добрый день, хотелось бы спросить одну вещь. Я облазил всю тему (наверное плохо искал) не подскажите как убрать эти отступы от краёв окна? Заранее спасибо за ответ Edited September 5, 2022 by F1nder @ Quote Link to comment Short link Share on other sites More sharing options...
hevi Posted September 6, 2022 Share Posted September 6, 2022 7 часов назад, F1nder сказал: Добрый день, хотелось бы спросить одну вещь. Я облазил всю тему (наверное плохо искал) не подскажите как убрать эти отступы от краёв окна? Заранее спасибо за ответ где код скрипта @ Quote Link to comment Short link Share on other sites More sharing options...
Qirashi Posted September 6, 2022 Share Posted September 6, 2022 Доброго дня. Использовал код ниже чтоб вывести изображение около курсора в меню компонентов. Суть вопроса в том, можно-ли вывести ещё и текстовое описание. Я мододел блица, но видел что-то похоже в WoT. Может есть код для такого или есть человек который выполнит это на заказ? #ifdef UNICODE #define A "W" #else #define A "A" #endif const UNDEF_INDEX = -777; ALPHA_BLEND_LEVEL = 255; // max=Byte=255 WS_EX_LAYERED = $80000; WS_EX_TRANSPARENT = $20; LWA_COLORKEY = 1; LWA_ALPHA = 2; GWL_EXSTYLE = (-20); var InfoPic: TBitmapImage; LastIndex: Integer; TempPath: String; PicForm: TForm; type COLORREF = DWORD; function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall'; function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall'; function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall'; function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall'; function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall'; procedure ShowPicHint(const PicFilePath: String); var pt: TPoint; begin if not GetCursorPos(pt) then Exit; InfoPic.Bitmap.LoadFromFile(PicFilePath); try with PicForm do begin SetBounds(ScaleX(pt.x + 16), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height); Show; end; finally SetFocus(WizardForm.Handle); end; end; procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea); var UndefPic: String; begin if Index = -1 then Exit; if Index = LastIndex then Exit; try case TNewCheckListBox(Sender).ItemCaption[Index] of ExpandConstant('{cm:CompName1}'): UndefPic := '1.bmp'; ExpandConstant('{cm:CompName2}'): UndefPic := '2.bmp'; ExpandConstant('{cm:CompName3}'): UndefPic := '3.bmp'; ExpandConstant('{cm:CompName4}'): UndefPic := '4.bmp'; ExpandConstant('{cm:CompName5}'): UndefPic := '5.bmp'; ExpandConstant('{cm:CompName6}'): UndefPic := '6.bmp'; ExpandConstant('{cm:CompName7}'): UndefPic := '7.bmp'; ExpandConstant('{cm:CompName8}'): UndefPic := '8.bmp'; ExpandConstant('{cm:CompName9}'): UndefPic := '9.bmp'; ExpandConstant('{cm:CompName10}'): UndefPic := '10.bmp'; ExpandConstant('{cm:CompName11}'): UndefPic := '11.bmp'; ExpandConstant('{cm:CompName12}'): UndefPic := '12.bmp'; ExpandConstant('{cm:CompName13}'): UndefPic := '13.bmp'; ExpandConstant('{cm:CompName14}'): UndefPic := '14.bmp'; ExpandConstant('{cm:CompName15}'): UndefPic := '15.bmp'; ExpandConstant('{cm:CompName16}'): UndefPic := '16.bmp'; ExpandConstant('{cm:CompName17}'): UndefPic := '17.bmp'; ExpandConstant('{cm:CompName18}'): UndefPic := '18.bmp'; ExpandConstant('{cm:CompName19}'): UndefPic := '19.bmp'; ExpandConstant('{cm:CompName20}'): UndefPic := '20.bmp'; ExpandConstant('{cm:CompName21}'): UndefPic := '21.bmp'; ExpandConstant('{cm:CompName22}'): UndefPic := '22.bmp'; ExpandConstant('{cm:CompName23}'): UndefPic := '23.bmp'; ExpandConstant('{cm:CompName24}'): UndefPic := '24.bmp'; ExpandConstant('{cm:CompName25}'): UndefPic := '25.bmp'; else begin LastIndex := UNDEF_INDEX; PicForm.Hide; Exit; end; end; if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic); ShowPicHint(TempPath + UndefPic); finally LastIndex := Index; end; end; procedure CompOnMouseLeave(Sender: TObject); begin PicForm.Hide; LastIndex := -1; end; procedure InitInfo(); begin WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove; WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave; TempPath := AddBackslash(ExpandConstant('{tmp}')); LastIndex := UNDEF_INDEX; PicForm := TForm.Create(WizardForm) with PicForm do begin BorderStyle := bsNone; FormStyle := fsStayOnTop; InfoPic := TBitmapImage.Create(PicForm) with InfoPic do begin Parent := PicForm; AutoSize := True; end; end; SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED); SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA); end; @ Quote Link to comment Short link Share on other sites More sharing options...
F1nder Posted September 6, 2022 Share Posted September 6, 2022 34 minutes ago, Qirashi said: Доброго дня. Использовал код ниже чтоб вывести изображение около курсора в меню компонентов. Суть вопроса в том, можно-ли вывести ещё и текстовое описание. Я мододел блица, но видел что-то похоже в WoT. Может есть код для такого или есть человек который выполнит это на заказ? #ifdef UNICODE #define A "W" #else #define A "A" #endif const UNDEF_INDEX = -777; ALPHA_BLEND_LEVEL = 255; // max=Byte=255 WS_EX_LAYERED = $80000; WS_EX_TRANSPARENT = $20; LWA_COLORKEY = 1; LWA_ALPHA = 2; GWL_EXSTYLE = (-20); var InfoPic: TBitmapImage; LastIndex: Integer; TempPath: String; PicForm: TForm; type COLORREF = DWORD; function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall'; function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] stdcall'; function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall'; function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall'; function SetFocus(hWnd: HWND): HWND; external '[email protected] stdcall'; procedure ShowPicHint(const PicFilePath: String); var pt: TPoint; begin if not GetCursorPos(pt) then Exit; InfoPic.Bitmap.LoadFromFile(PicFilePath); try with PicForm do begin SetBounds(ScaleX(pt.x + 16), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height); Show; end; finally SetFocus(WizardForm.Handle); end; end; procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea); var UndefPic: String; begin if Index = -1 then Exit; if Index = LastIndex then Exit; try case TNewCheckListBox(Sender).ItemCaption[Index] of ExpandConstant('{cm:CompName1}'): UndefPic := '1.bmp'; ExpandConstant('{cm:CompName2}'): UndefPic := '2.bmp'; ExpandConstant('{cm:CompName3}'): UndefPic := '3.bmp'; ExpandConstant('{cm:CompName4}'): UndefPic := '4.bmp'; ExpandConstant('{cm:CompName5}'): UndefPic := '5.bmp'; ExpandConstant('{cm:CompName6}'): UndefPic := '6.bmp'; ExpandConstant('{cm:CompName7}'): UndefPic := '7.bmp'; ExpandConstant('{cm:CompName8}'): UndefPic := '8.bmp'; ExpandConstant('{cm:CompName9}'): UndefPic := '9.bmp'; ExpandConstant('{cm:CompName10}'): UndefPic := '10.bmp'; ExpandConstant('{cm:CompName11}'): UndefPic := '11.bmp'; ExpandConstant('{cm:CompName12}'): UndefPic := '12.bmp'; ExpandConstant('{cm:CompName13}'): UndefPic := '13.bmp'; ExpandConstant('{cm:CompName14}'): UndefPic := '14.bmp'; ExpandConstant('{cm:CompName15}'): UndefPic := '15.bmp'; ExpandConstant('{cm:CompName16}'): UndefPic := '16.bmp'; ExpandConstant('{cm:CompName17}'): UndefPic := '17.bmp'; ExpandConstant('{cm:CompName18}'): UndefPic := '18.bmp'; ExpandConstant('{cm:CompName19}'): UndefPic := '19.bmp'; ExpandConstant('{cm:CompName20}'): UndefPic := '20.bmp'; ExpandConstant('{cm:CompName21}'): UndefPic := '21.bmp'; ExpandConstant('{cm:CompName22}'): UndefPic := '22.bmp'; ExpandConstant('{cm:CompName23}'): UndefPic := '23.bmp'; ExpandConstant('{cm:CompName24}'): UndefPic := '24.bmp'; ExpandConstant('{cm:CompName25}'): UndefPic := '25.bmp'; else begin LastIndex := UNDEF_INDEX; PicForm.Hide; Exit; end; end; if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic); ShowPicHint(TempPath + UndefPic); finally LastIndex := Index; end; end; procedure CompOnMouseLeave(Sender: TObject); begin PicForm.Hide; LastIndex := -1; end; procedure InitInfo(); begin WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove; WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave; TempPath := AddBackslash(ExpandConstant('{tmp}')); LastIndex := UNDEF_INDEX; PicForm := TForm.Create(WizardForm) with PicForm do begin BorderStyle := bsNone; FormStyle := fsStayOnTop; InfoPic := TBitmapImage.Create(PicForm) with InfoPic do begin Parent := PicForm; AutoSize := True; end; end; SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED); SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA); end; IMHO. Не рекомендую данный сопособ. Если очень много модов у некоторых пользователей может залагать картинка и повесить весь установщик так что советую другой способ. Там и описание есть и все необходимоеКомпонентлист с превью.zip @ Quote Link to comment Short link Share on other sites More sharing options...
Qirashi Posted September 6, 2022 Share Posted September 6, 2022 Уже использовал этот код, с ним есть огромный минус. Невозможно сделать нормальные фотографии к модам, их просто не видно из-за маленького размера. По этому я и стал искать вывод картинки у курсора, у меня вроде работает стабильно. Может быть есть код который не так сильно грузит установщик? @ Quote Link to comment Short link Share on other sites More sharing options...
F1nder Posted September 6, 2022 Share Posted September 6, 2022 2 minutes ago, Qirashi said: Уже использовал этот код, с ним есть огромный минус. Невозможно сделать нормальные фотографии к модам, их просто не видно из-за маленького размера. По этому я и стал искать вывод картинки у курсора, у меня вроде работает стабильно. Может быть есть код который не так сильно грузит установщик? Ну дело вкуса. Попробуй поиском поработать по теме. Главное галку поставить искать по теме. И попробуй найти. Может кто-то уже сталкивался с проблемой @ Quote Link to comment Short link Share on other sites More sharing options...
Qirashi Posted September 6, 2022 Share Posted September 6, 2022 Да искал уже... Тишина, ничего подобного нет. Но вроде у Джова в установщике было похожее, даже не лагало) @ 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.