




版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZJBS 001-2024 城市公共標(biāo)識(shí)系統(tǒng)設(shè)計(jì)規(guī)范
- T-ZSA 230-2024 虛擬數(shù)字人多模態(tài)交互信息規(guī)范
- 二零二五年度荒山土地流轉(zhuǎn)與林業(yè)碳匯項(xiàng)目合作合同
- 二零二五年度企業(yè)合規(guī)管理體系法律服務(wù)合同范本
- 二零二五年度離婚協(xié)議書(shū)模板及婚姻關(guān)系終止及財(cái)產(chǎn)分配
- 二零二五年度診所醫(yī)療事故處理及責(zé)任劃分合同
- 二零二五年度養(yǎng)老護(hù)理型住宅正規(guī)房屋出租合同
- 二零二五年度混凝土班組勞務(wù)合作施工安全責(zé)任合同
- 二零二五年度銷(xiāo)售信息保密管理承諾書(shū)
- 2025年度耕地租賃與農(nóng)業(yè)科技推廣合同
- DB33- 1015-2021《居住建筑節(jié)能設(shè)計(jì)標(biāo)準(zhǔn)》
- DB1310T 225-2020 木本植物滯納空氣顆粒物能力測(cè)定方法
- (高職)國(guó)際金融(第四版)電子課件(全套)
- 《飲料工藝學(xué)》課件第一章-緒論
- 中外合作辦學(xué)的可行性報(bào)告
- 母嬰保健課程標(biāo)準(zhǔn)
- 《農(nóng)民專(zhuān)業(yè)合作社登記管理?xiàng)l例》條文解讀(一
- 一年級(jí)的小豌豆我喜歡的一本書(shū)(課堂PPT)
- 電廠機(jī)組深度調(diào)峰摸底試驗(yàn)方案
- 地球上的大氣知識(shí)結(jié)構(gòu)圖
- 新加坡SM1向性測(cè)試模擬試卷
評(píng)論
0/150
提交評(píng)論