fcorbelli / zpaqfranz

Deduplicating archiver with encryption and paranoid-level tests. Swiss army knife for the serious backup and disaster recovery manager. Ransomware neutralizer. Win/Linux/Unix
MIT License
278 stars 25 forks source link

SFX GUI (or more interactivity) #19

Closed dertuxmalwieder closed 2 years ago

dertuxmalwieder commented 2 years ago

I consider using zpaqfranz for the sfx archives of my Vim builds as it squeezes one or two MB out of the file size (I tried it with v54). Yet, the usability is limited as the .exe files don’t provide a way to (easily) set the target directory.

I know that low-level Windows I/O is a mess, but I’d like to suggest that the SFX module lets the user choose the target directory, either with a pop-up or with a terminal input.

fcorbelli commented 2 years ago

A GUI I'd say no (I have exactly two sfx module users, too much work)
If instead you want "something" that ask for the path where to extract, I can do it.
If you give me a reliable C/C ++ function to read a string from the console, starting with a default one I'm too lazy to write it :)

fcorbelli commented 2 years ago

If it is enough...

string getline(string i_default) 
{
    size_t maxline  = 255+1;
    char* line      = (char*)malloc(maxline); // sfx module, keep it small
    char* p_line    = line;
    int c;

    if (line==NULL)
        error("744: allocating memory");

    if (i_default!="")
        printf("%s",i_default.c_str());

    while((unsigned)(p_line-line)<maxline) 
    {
        c = fgetc(stdin);

        if(c==EOF)
            break;

        if((*p_line++ = c)=='\n')
            break;
    }
    *--p_line = '\0';
    return line;
}

sfx55_1a.zip

fcorbelli commented 2 years ago

55_1n.zip If you do not select a -sfxto the SFX module will ask

zpaqfranz a z:\myarchive.zpaq *.cpp -sfx z:\pippero\autoextraction.exe

Do you like ?

dertuxmalwieder commented 2 years ago

Yup! :) Well, a start. Thank you!