Gde u menea asibka ne redktiruet fail pamaghite pajalusta vot kod
Код:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[files]
Source: "setup.ini"; DestDir: "{app}"; Flags: ignoreversion ; Components: triobar;
[Components]
Name: "triobar"; Description: "Triobar"; Flags: disablenouninstallwarning
[code]
function SetupEdit(SetupName, OldSetupValue, NewSetupValue: String): Boolean;
var
Setup: TStringList;
SetupSetStr: TArrayOfString;
SetupDir, FileName, Tmp: String;
begin
SetupDir:=ExpandConstant('{app}');
FileName:=SetupDir + SetupName;
If FileExists(FileName) then
begin
Setup:=TStringList.Create;
try
Setup.LoadFromFile(SetupDir + SetupName);
Tmp:=Setup.Text;
StringChange(Tmp, OldSetupValue, NewSetupValue);
Setup.Text:=Tmp;
Setup.SaveToFile(SetupDir + SetupName);
finally
Setup.Free;
end;
end;
end;
procedure triobar();
begin
If IsComponentSelected('triobar') then
begin
SetupEdit('{app}\Setup.ini', 'DbName=localhost: D:\Incoming\TrioBarWork\_FreshBase,', 'DbName=localhost: {app}\FRONT.FDB,');
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep = ssPostInstall then
begin
triobar();
end;
end;
Вложения
-
794 байт Просмотры: 13