INNOSETUP卸載程序中加入自定義窗體(窗口)_第1頁(yè)
INNOSETUP卸載程序中加入自定義窗體(窗口)_第2頁(yè)
INNOSETUP卸載程序中加入自定義窗體(窗口)_第3頁(yè)
INNOSETUP卸載程序中加入自定義窗體(窗口)_第4頁(yè)
INNOSETUP卸載程序中加入自定義窗體(窗口)_第5頁(yè)
已閱讀5頁(yè),還剩2頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、INNO SETUPD?3 Do ?D?oe ?X ? "o ?,°i ?£"° ?u£ SetupAppName=My ProgramAppVerName=My Program v.1.2 DefaultDirName=pfMy ProgramFilesSource: Files*; DestDir: app_CodeconstbidDelAll = 1;bidSkipAll = 2;varForm: TSetupForm;CheckListBox: TNewCheckListBox;AllButton, UnAllButton:

2、TButton;CancelButton, DelButton: TButton;StaticText: TNewStaticText;MsgForm: TSetupForm;MsgAllButton, MsgSkipAllButton: TButton; MsgCancelButton, MsgDelButton: TButton;DelAllReadOnly: Boolean;SkipAllReadOnly: Boolean;CheckDirs, CheckFiles: Boolean;function Size64(Hi, Lo: integer): Extended; vari: in

3、teger;begin Result:= Lo;if Lo < 0 thenResult:= Result + 2147483647 + 2147483647 + 2;i:= Hi; while i > 0 dobeginResult:= Result + 2147483647 + 2147483647 + 2; i:= i - 1;end;end;procedure FillListBox(const fromDir, fileMask: string; Level: Byte); varFSR, DSR: TFindRec;FindResult: Boolean;APath:

4、string;i: integer;beginAPath := AddBackslash(fromDir);FindResult := FindFirst(APath + fileMask, FSR);trywhile FindResult and CheckFiles dobeginif FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 thenbeginfiles i:= CheckListBox.AddCheckBox(FSR.Name,FloatToStr(Size64(FSR.SizeHigh, FSR.SizeLow) + byte&#

5、39;,Level, True, True, False, True, TStringList.Create);TStrings(CheckListBox.ItemObjecti).Text:= APath FSR.Name;end;FindResult := FindNext(FSR);end;FindResult := FindFirst(APath + '*.*', DSR);while FindResult and CheckDirs dobeginCheckFiles:= True;if (DSR.Attributes and FILE_ATTRIBUTE_DIREC

6、TORY) FILE_ATTRIBUTE_DIRECTORY) andnot (DSR.Name = '.') or (DSR.Name = '.') thenbegindir i:= CheckListBox.AddCheckBox(DSR.Name,'DIR', Level,True, True, False, True, TStringList.Create);TStrings(CheckListBox.ItemObjecti).Text:= APath DSR.Name;Recursion FillListBox(APath + DSR.

7、Name, fileMask, Level+1);end;FindResult := FindNext(DSR);end;finallyFindClose(FSR);FindClose(DSR);end;end;procedure ButtonOnClick(Sender: TObject);beginif TButton(Sender).Tag = 0 thenCheckListBox.CheckItem(0, coCheckWithChildren)elseCheckListBox.CheckItem(0, coUnCheck);end;procedure MsgButtonOnClick

8、(Sender: TObject);beginCase TButton(Sender).Tag ofbidDelAll : DelAllReadOnly:= True;bidSkipAll: SkipAllReadOnly:= True;end;MsgForm.Close;end;function DelMsgBox(FileName: string): Boolean;varMsgLabel: TLabel;beginMsgForm:= CreateCustomForm;MsgForm.ClientWidth := ScaleX(400);MsgForm.ClientHeight := Sc

9、aleY(120);MsgForm.Caption := 'Files to delete'MsgForm.Center;MsgLabel := TLabel.Create(MsgForm);MsgLabel.Left := ScaleX(20);MsgLabel.Top := ScaleY(20);READONLY attribute?'MsgLabel.Caption:= FileName + ' is protected file or directory!' + #10#10#13 + 'Do you want to delete the

10、 file with MsgLabel.Parent := MsgForm;MsgAllButton := TButton.Create(MsgForm);MsgAllButton.Parent := MsgForm;MsgAllButton.Width := ScaleX(75);MsgAllButton.Height := ScaleY(23);MsgAllButton.Left := ScaleX(20);MsgAllButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);MsgAllButton.Caption := 'Dele

11、te All'MsgAllButton.Tag:= bidDelAll;MsgAllButton.OnClick := MsgButtonOnClick;MsgSkipAllButton := TButton.Create(MsgForm);MsgSkipAllButton.Parent := MsgForm;MsgSkipAllButton.Width := ScaleX(75);MsgSkipAllButton.Height := ScaleY(23);MsgSkipAllButton.Left := MsgAllButton.Left + MsgAllButton.Width +

12、ScaleX(10);MsgSkipAllButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10);MsgSkipAllButton.Caption := 'Skip All'MsgSkipAllButton.Tag:= bidSkipAll;MsgSkipAllButton.OnClick := MsgButtonOnClick;MsgCancelButton := TButton.Create(MsgForm);MsgCancelButton.Parent := MsgForm;MsgCancelButton.Width :=

13、 ScaleX(75);MsgCancelButton.Height := ScaleY(23);MsgCancelButton.Left := MsgForm.ClientWidth - MsgCancelButton.Width - ScaleX(20);MsgCancelButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10); MsgCancelButton.Caption := 'Skip'MsgCancelButton.ModalResult := mrCancel;MsgDelButton := TButton.Cr

14、eate(MsgForm);MsgDelButton.Parent := MsgForm;MsgDelButton.Width := ScaleX(75);MsgDelButton.Height := ScaleY(23);MsgDelButton.Left := MsgCancelButton.Left - MsgDelButton.Width - ScaleX(10);MsgDelButton.Top := MsgForm.ClientHeight - ScaleY(23 + 10); MsgDelButton.Caption := 'Delete'MsgDelButton

15、.ModalResult := mrOk;MsgForm.ActiveControl:= MsgCancelButton;if MsgForm.ShowModal() = mrOk thenResult:= TrueelseResult:= False;end;procedure DeleteFiles();varSR: TFindRec;i: integer;str: string;ResultCode: Integer;beginDelAllReadOnly:= False;SkipAllReadOnly:= False;for i:= CheckListBox.Items.Count -

16、 1 downto 0 dobeginif CheckListBox.Statei = cbChecked then beginstr:= Trim(TStrings(CheckListBox.ItemObjecti).Text);FindFirst(str, SR);if (SR.Attributes and FILE_ATTRIBUTE_READONLY) FILE_ATTRIBUTE_READONLY) thenif Not (DelAllReadOnly or SkipAllReadOnly) thenif DelMsgBox(SR.Name) then Exec('attri

17、b', ' -h -s -r ' + '"' + str + '"','', SW_HIDE, ewWaitUntilTerminated, ResultCode);if DelAllReadOnly then Exec('attrib', ' -h -s -r ' + '"' + str + '"','', SW_HIDE, ewWaitUntilTerminated, ResultCode);Find

18、Close(SR); DeleteFile(str);RemoveDir(str);end;end;end;procedure BrowseRemainedFiles();beginForm:= CreateCustomForm;Form.ClientWidth := ScaleX(400);Form.ClientHeight := ScaleY(400);Form.Caption := 'Files to delete'Form.Center;StaticText := TNewStaticText.Create(Form);StaticText.Left:= ScaleX(

19、20);StaticText.Top := ScaleY(8);#10#13StaticText.Caption := 'Some elements could not be removed.' + +'These can be removed manually.' + #10#13#13 + 'Choose which are necessary to delete' + #10#13'or press Cancel button.'StaticText.Font.Color:= clBlue;StaticText.Font.S

20、tyle:= fsBold;StaticText.AutoSize := True;StaticText.Parent := Form;CheckListBox := TNewCheckListBox.Create(Form);CheckListBox.Left:= ScaleX(20);CheckListBox.Top:= ScaleY(20);CheckListBox.Width:= Form.ClientWidth - ScaleX(20*2); CheckListBox.Height:= Form.ClientHeight - ScaleY(23*2 + 20);/ CheckList

21、Box.Offset:= 0;CheckListBox.Parent:= Form;AllButton := TButton.Create(Form);AllButton.Parent := Form;AllButton.Width := ScaleX(75);AllButton.Height := ScaleY(23);AllButton.Left := ScaleX(20);AllButton.Top := Form.ClientHeight - ScaleY(23 + 10);AllButton.Caption := 'Select All'AllButton.Tag:=

22、 0;AllButton.OnClick := ButtonOnClick;UnAllButton := TButton.Create(Form);UnAllButton.Parent := Form;UnAllButton.Width := ScaleX(75);UnAllButton.Height := ScaleY(23);UnAllButton.Left := AllButton.Left + AllButton.Width + ScaleX(10);UnAllButton.Top := Form.ClientHeight - ScaleY(23 + 10);UnAllButton.C

23、aption := 'Clear All'UnAllButton.Tag:= 1;UnAllButton.OnClick := ButtonOnClick;CancelButton := TButton.Create(Form);CancelButton.Parent := Form;CancelButton.Width := ScaleX(75);CancelButton.Height := ScaleY(23);CancelButton.WidthCancelButton.Left := Form.ClientWidth - ScaleX(20);CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);CancelButton.Caption := 'Cancel'CancelButton.ModalResult := mrCancel;CancelButton.Cancel := True;DelButton := TButton.Create(Form);DelButton.Parent := Form;DelButton.Width := ScaleX(75);DelButton.Height := ScaleY(23);D

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論