spider91
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Для примера приведенного ниже, необходимо названия "прекомпрессированных" файлов привести к виду "имя_файла.расширение.pcf" [Files] Source: "precomp\*"; DestDir: "{tmp}"; Flags: ignoreversion overwritereadonly Source: "Data\*"; DestDir: "{app}"; Flags: overwritereadonly recursesubdirs ignoreversion createallsubdirs sortfilesbyextension; AfterInstall: RecompressPCF [Code] procedure RecompressPCF; var Tmp, Text, InputFile, OutputFile: string; n, ResultCode: Integer; begin if ExtractFileExt(CurrentFileName)='.pcf' then begin InputFile:=ExpandConstant(CurrentFileName); n:=Length(InputFile); while InputFile[n]<>'.' do n:=n-1; OutputFile:=Copy(InputFile, 1, n-1); Text:=WizardForm.StatusLabel.Caption; WizardForm.StatusLabel.Caption:='Рекомпрессия извлеченного файла...'; WizardForm.FileNameLabel.Caption:=OutputFile; Tmp:=ExpandConstant('{tmp}\'); Exec(Tmp+'precomp.exe', '-d -o"'+OutputFile+'" "'+InputFile+'"', Tmp, SW_HIDE, ewWaitUntilTerminated, ResultCode); DeleteFile(InputFile); WizardForm.StatusLabel.Caption:=Text; end; [b]2-ой вариант[/b] [code] procedure CurStepChanged(CurStep: TSetupStep); begin If CurStep=ssInstall then begin Exec(ExpandConstant('{app}\precomp.exe'), ' -r data.pcf ', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\data.pcf')); | Всего записей: 605 | Зарегистр. 02-02-2009 | Отправлено: 15:02 24-04-2009 | Исправлено: Maz, 14:53 06-09-2021 |
|