Author Topic: UnpackFile OVERWRITEALL  (Read 31449 times)

pncdaspropagandas

  • Contributor
  • Active Member
  • *****
  • Posts: 93
    • View Profile
UnpackFile OVERWRITEALL
« on: August 11, 2017, 13:34:15 »
Hi,

I am trying to write a script that extract all selected archives to current directory and overwrite all files.

The problem is that the option OVERWITEALL is not working for me. When I run the script, the "Would you like to replace the existing file?" window shows and I have to choose a option for each selected archive. I'm using MC 7.4 build 2377. I wonder if I am doing something wrong here.

@var $source_path = GetSourcePath();
@var $arr_selected_file_paths[] = GetSourceSelectedPaths();

@var $n;
for( $n=0; $n<arrayCount($arr_selected_file_paths); $n++ )
{
   @var $test = UnpackFile($arr_selected_file_paths[$n], $source_path, "*.*", "OVERWRITEALL, USEEXISTINGQUEUE, NOWAIT");
   LogAppInfo($test);
}

Thanks

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4484
    • View Profile
    • Multi Commander
Re: UnpackFile OVERWRITEALL
« Reply #1 on: August 11, 2017, 17:28:34 »
I don't get that. It works for me..
Do you have permission to overwrite it ?


pncdaspropagandas

  • Contributor
  • Active Member
  • *****
  • Posts: 93
    • View Profile
Re: UnpackFile OVERWRITEALL
« Reply #2 on: August 11, 2017, 18:55:53 »
Yes, I do.

I did another test and downloaded the stable version to see if maybe it was any customization I made that caused the problem and the result was the same.

I have these files:
langs.model.7z
langs.model.xml
uninstall.7z
uninstall.exe

- I delete langs.model.xml and uninstall.exe and select the 7z files
- Run the script (fine, no overwriting)
- Run the script again -> replace confirmation window shows up

Also tested with only uninstall.7z selected

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4484
    • View Profile
    • Multi Commander
Re: UnpackFile OVERWRITEALL
« Reply #3 on: August 11, 2017, 18:58:00 »
Ahh 7z.. might be that. I only tested zip.. I will check again later.

pncdaspropagandas

  • Contributor
  • Active Member
  • *****
  • Posts: 93
    • View Profile
Re: UnpackFile OVERWRITEALL
« Reply #4 on: August 11, 2017, 19:43:54 »
Indeed! Tested here and zip files overwrite as normal, but 7z don't!

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4484
    • View Profile
    • Multi Commander
Re: UnpackFile OVERWRITEALL
« Reply #5 on: August 12, 2017, 14:40:25 »
Will fix that for next version