Tapas77789
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору [Setup] AppName=MyApp AppVerName=MyApp DefaultDirName=D:\MyApp UninstallFilesDir={app}\uninsfiles [Dirs] Name: {app}\uninsfiles; [Files] Source: compiler:Dll Pack\CallbackCtrl.dll; DestDir: {app}\uninsfiles; Flags: ignoreversion Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs [_code] type Un_TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord); var PercentsTimer: LongWord; PercentsLabel: TLabel; function Un_WrapTimerProc(callback: Un_TTimerProc; Paramcount: Integer): longword; external 'wrapcallbackaddr@{tmp}\CallbackCtrl.dll stdcall delayload'; function Un_SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32.dll stdcall delayload'; function Un_KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall delayload'; Function Un_NumToStr(Float: Extended): String; Begin Result:= Format('%.1n', [Float]); StringChange(Result, ',', '.'); while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do SetLength(Result, Length(Result)-1); End; function InitializeUninstall(): Boolean; begin FileCopy(ExpandConstant('{app}\uninsfiles\callbackctrl.dll'), ExpandConstant('{tmp}\callbackctrl.dll'), False); Result:= True; end; Procedure PercentsProc(h, msg, idevent, dwTime: Longword); Begin with UninstallProgressForm.ProgressBar do begin PercentsLabel.Caption:= 'Прогресс: ' + Un_NumToStr((Position * 100)/Max) + '.' + Chr(48 + Position mod 10) + ' %'; end; End; procedure CurUninstallStepChanged(CurStep: TUninstallStep); begin if (CurStep=usUninstall) then begin PercentsTimer:= Un_SetTimer(0, 0, 100, Un_WrapTimerProc(@PercentsProc, 4)); end; if (CurStep=usPostUninstall) then begin Un_KillTimer(0, PercentsTimer); end; end; procedure InitializeUninstallProgressForm(); begin PercentsLabel:= TLabel.Create(UninstallProgressForm); with PercentsLabel do begin Left:= UninstallProgressForm.ProgressBar.Left; Top:= UninstallProgressForm.ProgressBar.Top + UninstallProgressForm.ProgressBar.Height + ScaleY(10); Width:= ScaleX(100); Height:= ScaleY(15); AutoSize:= False; Transparent := True; Parent:= UninstallProgressForm.ProgressBar.Parent; end; end; | Всего записей: 70 | Зарегистр. 26-05-2008 | Отправлено: 19:57 22-08-2012 | Исправлено: Tapas77789, 19:58 22-08-2012 |
|