Ekspoint Posted February 17, 2015 Share Posted February 17, 2015 Скрываешь объект, а потом через кейс в CurPageChanged показываешь его там, где нужно. ага, понял @ Quote Link to comment Short link Share on other sites More sharing options...
voin_123 Posted February 17, 2015 Share Posted February 17, 2015 Чо делать что б появилася менюшка удаление и бэкапа res_mods ? @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 17, 2015 Share Posted February 17, 2015 (edited) Всем Доброго Времени Суток!!! ... помогите со скриптом для BackUpPage ... мне нужно чтобы не папки удалились ("бекапились") а файлы... 'сам скрипт' #include "SHFileOperation.iss" [Code] var BackupPage: TWizardPage; DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton; const BackupDescText = 'Выберите необходимый пункт из представленных.' #13#13 'Во избежание проблем совместимости и конфликтов между модами, рекомендуется удалить ваш старый XVM.'; DeleteDescText = 'Установщик удалит ваш старый XVM, который был установлен ранее'; MoveDescText = 'Установщик сделает резервную копию старого XVM, востановить его сможите из папки res_mods\backup.'; NoneDescText = 'Установщик установит XVM поверх старого.'; function BackupCheck_1(): Boolean; var BackupDescLabel, DeleteDescLabel, MoveDescLabel, NoneDescLabel: TLabel; begin BackupPage:=CreateCustomPage(wpWelcome, 'Создание резервных копий файлов перед установкой', 'Пожалуйста, прочтите следующую важную информацию перед тем, как продолжить.'); BackupDescLabel:=TLabel.Create(WizardForm); BackupDescLabel.Parent:=BackupPage.Surface; BackupDescLabel.Left:=110; BackupDescLabel.Top:=10; BackupDescLabel.Width:=BackupPage.SurfaceWidth; BackupDescLabel.Height:=90; BackupDescLabel.AutoSize:=False; BackupDescLabel.Wordwrap:=True; BackupDescLabel.Caption:=BackupDescText; DeleteRadioButton:=TNewRadioButton.Create(WizardForm); DeleteRadioButton.Parent:=BackupPage.Surface; DeleteRadioButton.Checked:=True; DeleteRadioButton.Top:=105; DeleteRadioButton.Left:=110; DeleteRadioButton.Width:=BackupPage.SurfaceWidth; DeleteRadioButton.Font.Style:=[fsBold]; DeleteRadioButton.Font.Size:=9; DeleteRadioButton.Caption:='Удалить старый XVM' DeleteDescLabel:=TLabel.Create(WizardForm); DeleteDescLabel.Parent:=BackupPage.Surface; DeleteDescLabel.Left:=110; DeleteDescLabel.Top:=DeleteRadioButton.Top + DeleteRadioButton.Height + 4; DeleteDescLabel.Width:=BackupPage.SurfaceWidth; DeleteDescLabel.Height:=40; DeleteDescLabel.AutoSize:=False; DeleteDescLabel.Wordwrap:=True; DeleteDescLabel.Caption:=DeleteDescText; MoveRadioButton:=TNewRadioButton.Create(WizardForm); MoveRadioButton.Parent:=BackupPage.Surface; MoveRadioButton.Checked:=False; MoveRadioButton.Top:=180; MoveRadioButton.Left:=110; MoveRadioButton.Width:=BackupPage.SurfaceWidth; MoveRadioButton.Font.Style:=[fsBold]; MoveRadioButton.Font.Size:=9; MoveRadioButton.Caption:='Сделать резервную копию XVM' MoveDescLabel:=TLabel.Create(WizardForm); MoveDescLabel.Parent:=BackupPage.Surface; MoveDescLabel.Left:=110; MoveDescLabel.Top:=MoveRadioButton.Top + MoveRadioButton.Height + 4; MoveDescLabel.Width:=BackupPage.SurfaceWidth; MoveDescLabel.Height:=40; MoveDescLabel.AutoSize:=False; MoveDescLabel.Wordwrap:=True; MoveDescLabel.Caption:=MoveDescText; NoneRadioButton:=TNewRadioButton.Create(WizardForm); NoneRadioButton.Parent:=BackupPage.Surface; NoneRadioButton.Checked:=False; NoneRadioButton.Top:=255; NoneRadioButton.Left:=110; NoneRadioButton.Width:=BackupPage.SurfaceWidth; NoneRadioButton.Font.Style:=[fsBold]; NoneRadioButton.Font.Size:=9; NoneRadioButton.Caption:='Установить поверх старого XVMa' NoneDescLabel:=TLabel.Create(WizardForm); NoneDescLabel.Parent:=BackupPage.Surface; NoneDescLabel.Left:=110; NoneDescLabel.Top:=NoneRadioButton.Top + NoneRadioButton.Height + 4; NoneDescLabel.Width:=BackupPage.SurfaceWidth; NoneDescLabel.Height:=40; NoneDescLabel.AutoSize:=False; NoneDescLabel.Wordwrap:=True; NoneDescLabel.Caption:=NoneDescText; end; function BackupCheck_2(): Boolean; begin If DeleteRadioButton.Checked then begin DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\battle.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\Minimap.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\PlayersPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\StatisticForm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\TeamBasesPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\VehicleMarkersManager.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\xvm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True); CreateDir(ExpandConstant('{app}\res_mods\{#Patch}')); end; end; function BackupCheck_3(): Boolean; begin If MoveRadioButton.Checked then begin MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\battle.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\Minimap.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\PlayersPanel.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\StatisticForm.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\TeamBasesPanel.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\VehicleMarkersManager.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\xvm.swf'),ExpandConstant('{app}\res_mods\backup\{#Patch}')); MoveDir(ExpandConstant('{app}\res_mods\configs\'),ExpandConstant('{app}\res_mods\backup\configs')); MoveDir(ExpandConstant('{app}\res_mods\mods\'),ExpandConstant('{app}\res_mods\backup\mods')); CreateDir(ExpandConstant('{app}\res_mods\{#Patch}')); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\battle.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\Minimap.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\PlayersPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\StatisticForm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\TeamBasesPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\VehicleMarkersManager.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\xvm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True); end; end; procedure CurStepChanged(CurStep: TSetupStep); begin If CurStep=ssInstall then begin BackupCheck_2(); BackupCheck_3(); end; end; procedure InitializeWizard1(); begin BackupCheck_1(); end; я походу что то не так делаю ((( Edited February 17, 2015 by MS_RAMIS @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 17, 2015 Share Posted February 17, 2015 (edited) @voin_123, по скрину можно сказать только одно: отсутствует директива препроцессора Patch. В начале скрипта объявите: #define Patch "0.9.6" я походу что то не так делаю ((( Для начала, непонятно объясняете. Edited February 17, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted February 17, 2015 Share Posted February 17, 2015 как к bmp сделать функцию закрытия окна? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 17, 2015 Share Posted February 17, 2015 как к bmp сделать функцию закрытия окна? Как тебя понять? @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 17, 2015 Share Posted February 17, 2015 #define Patch "0.9.6" у меня прописано это ... сне нужно чтобы при удалении , удалялись не папки с их содержимым , а именно конкретные файлы ... вот указал я в скрипте 'кусок скрипта ' DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\battle.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\Minimap.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\PlayersPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\StatisticForm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\TeamBasesPanel.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\VehicleMarkersManager.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\xvm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True); CreateDir(ExpandConstant('{app}\res_mods\{#Patch}')); при резервном копирование вроде все работает .... а при удаление файлы остаются ((( @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted February 17, 2015 Share Posted February 17, 2015 Как тебя понять? как сделать так что бы при нажатии на картинку окно закрывалось @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 17, 2015 Share Posted February 17, 2015 (edited) как сделать так что бы при нажатии на картинку окно закрывалось В ботве это BtnSetEvent. А если изображение на панели, то через свойство OnClick. а при удаление файлы остаются Потому что DelTree - функция для удаления каталогов. Для удаления файлов есть функции DeleteFile, DelFiles Edited February 17, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 18, 2015 Share Posted February 18, 2015 Потому что DelTree - функция для удаления каталогов. Для удаления файлов есть функции DeleteFile, DelFiles с написал так но выдает ошибку((( DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\battle.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\Minimap.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\PlayersPanel.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\StatisticForm.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\TeamBasesPanel.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\VehicleMarkersManager.swf'), True, True, True); DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\scaleform\xvm.swf'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\configs'), True, True, True); DelTree(ExpandConstant('{app}\res_mods\mods'), True, True, True); CreateDir(ExpandConstant('{app}\res_mods\{#Patch}')); и через DelFiles пробовал ... результат ошибка ((( Kotyarko_O если тебя не затруднит подскажи как эта функция должна быть написана правильно!?!?!? @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted February 18, 2015 Share Posted February 18, 2015 В ботве это BtnSetEvent. А если изображение на панели, то через свойство OnClick. OnClick := ? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 18, 2015 Share Posted February 18, 2015 с написал так но выдает ошибку((( Конечно, здесь простого копипаста не хватит.Здесь много лишних параметров: DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf'), True, True, True); Нужно так: DeleteFile(ExpandConstant('{app}\res_mods\{#Patch}\gui\flash\Application.swf')); OnClick := ? Вопрос в чём?Правильно ли приведённое тобой свойство, или что там должно быть дальше? 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted February 18, 2015 Share Posted February 18, 2015 Вопрос в чём? Правильно ли приведённое тобой свойство, или что там должно быть дальше? [Code] procedure information(Sender:Tobject); var informationrtf: ansiString; informationForm: TSetupForm; informationEdit: TRichEditViewer; informationImage: TBitmapImage; begin ExtractTemporaryFile('Информация.rtf'); LoadStringFromFile(ExpandConstant('{tmp}')+'\Информация.rtf', informationrtf); //""""""""""""""""""""""""""""""""""""""""""""""// informationForm := CreateCustomForm(); with informationForm do begin ClientWidth:=ScaleX(700); ClientHeight:=ScaleY(570); Caption := 'Информация о Модпаке'; CenterInsideControl(WizardForm, False); //""""""""""""""""""""""""""""""""""""""""""""""// informationEdit := TRichEditViewer.Create(informationForm); with informationEdit do begin SetBounds(ScaleX(10),ScaleY(10),ScaleX(680),ScaleY(510)); Parent := informationForm; Font.Size := 8; RTFText:= informationrtf; ScrollBars := ssVertical; end; //""""""""""""""""""""""""""""""""""""""""""""""// informationImage := TBitmapImage.Create(informationForm); with informationImage do begin SetBounds(ScaleX(310),ScaleY(530),ScaleX(100),ScaleY(32)); Parent := informationForm; ExtractTemporaryFile('WizardForm.MenuImage.bmp'); MenuImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.MenuImage.bmp')); ModalResult:= mrOk; Cursor := crHand; end; ShowModal; Free; end; end; @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 18, 2015 Share Posted February 18, 2015 Kotyarko_O + спасибо большое .... все работает ;) @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 18, 2015 Share Posted February 18, 2015 (edited) , вписывай OnClick и делай для него процедуру. Первый день с инно занимаешься, что-ли? Edited February 18, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 18, 2015 Share Posted February 18, 2015 еще есть вопрос .... а можно сделать так чтобы при выборе "родительского" компонента не выбирались "дочернии" извините за мой русский. Может на скрине будет понятнее ... @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 18, 2015 Share Posted February 18, 2015 (edited) а можно сделать так чтобы при выборе "родительского" компонента не выбирались "дочернии" Flags: dontinheritcheck Edited February 18, 2015 by Kotyarko_O 2 @ Quote Link to comment Short link Share on other sites More sharing options...
MS_RAMIS Posted February 18, 2015 Share Posted February 18, 2015 Kotyarko_O + еще раз спасибо ))) @ Quote Link to comment Short link Share on other sites More sharing options...
woole Posted February 18, 2015 Share Posted February 18, 2015 Flags: dontinheritcheck Странная привычка, плюсую все твои полезные ответы. Зачем я это делаю? 3 @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted February 18, 2015 Share Posted February 18, 2015 Зачем я это делаю? Потому что они полезные :) 1 @ 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.