#1 Re: mORMot 1 » NewPascal preview - fork for mORMot » 2016-08-07 22:07:28

I just came to this thread via a suggestion on the Lazarus list.
It seems like what I want, i.e. being able to develop against a Raspberry Pi (ARM7) on my Win7 laptop including crosscompiling for the Pi.
Currently I have installed FPC 3.0/Lazarus 1.6 directly on the target RPi3 and use that as platform, but it is less than optimal for many reasons...

However this business with installation to C:/NewPascal is stopping me.
I only ever install programs on the C drive to C:\Programs (outside of the Microsoft cointrolled folders), everything else goes into my 2 TB D: data drive.
The install instructions for NewPascal says it can only ever be installed into C:\NewPascal, otherwise it will not work.

After extracting it into D:\NewPascal I searched for the string "C:\NewPascal" in xml and config files from the root of the installation using:

grep -d+ -i+ "C:\\NewPascal" *.xml *.c*

The result was disappointing because this string is put in a whole lot of files all over the place, so I cannot figure a way to safely change them, not even by changing C: to D:

What happened to the path change script/program?

--
Bo B

#2 Re: Other components » PasZip - how to embed extract folder in zipfile » 2016-07-12 16:11:07

Just store the relative path within the file name.

With what command can I do that?
If I use a "trick" path by replacing the supplied path in the ZW.AddDeflated call then I assume that the system cannot find the fie to add into the zip...
Is there a property or similar I can use to tell the zip that the file should be extracted to say ./MyFileName?

#3 Re: Other components » PasZip - how to embed extract folder in zipfile » 2016-07-12 09:25:31

I forgot to mention my use so below is the code.
Notice that the list of files are supplied in a stringlist and these contain the full path to the files to zip.
They can be located in different places on the file system but I want them to be extracted together.

function TSSCommHandler.ZipFiles(TargetFile: string; FileList: TStringList): boolean;
{This function uses the Synopse files PasZip.pas and Synopse.inc to create the zipfile.
Files were obtained from http://synopse.info/fossil/dir?ci=tip}
var
  ZW: TZipWrite;
  i: integer;
  FileName: string;
begin
  Result := false;
  ZW := TZipWrite.Create(TargetFile);
  try
    try
      for i := 0 to FileList.Count-1 do
      begin
        FileName := FileList[i];
        if not FileExists(FileName) then Continue;
        ZW.AddDeflated(FileName); //How do I add a relative path here?
      end;
      Result := true;
    except
      on E: Exception do
      begin
        FLastError := 'Zip error: ' + E.Message;
        exit;
      end;
    end;
  finally
    ZW.Free;
  end;
end;

Any ideas on where/how I should add the target extraction path (relative to zipfile)?

#4 Other components » PasZip - how to embed extract folder in zipfile » 2016-07-12 06:16:38

Bob_AGI
Replies: 3

I have downloaded the PasZip.pas unit for my Delphi 2007 usage in order to store data files in a zipfile in the simplest way.
The data files I must store all pertain to a particular measurement result and comprise both binary and text files.
All works fine so far except for one item:

I need to set the path of extraction into the zipfile such that on extraction using any zip utility such as WinZip, 7Zip, WinRar etc all the zipped files get extracted into a directory below the location of the zipfile.
The name of the directory could be the name of the zipfile (without extension) or a unique dir name embedded into the zipfile, it is just important that the files are not extracted into the current dir.

I have searched for this but I only found one search result and this is another user asking here for how to embed a relative extraction path into the zip using TZipWrite. There is no reply for this question...
See here: store relative paths

I it possible to do with PasZip?

Board footer

Powered by FluxBB