0

I am looking for some help with python script to create a Self Extracting Archive (SFX) an exe file which can be created by WinRar basically.

I would want to archive a folder with password protection and also split volume by 3900 MB so that it can be easily burned to a disk.

I know WinRar has command line parameters to create a archive, but i am not sure how to call it via python anyhelp on this would be of great help.

Here are main things I want: Archive Format - RAR Compression Method Normal Split Volume size, 3900 MB Password protection

I looked up everywhere but don't seem to find anything around this functionality.

daaredevill
  • 31
  • 3
  • 8

1 Answers1

0

You could have a look at rarfile

Alternatively use something like:

from subprocess import call
cmdlineargs = "command -switch1 -switchN archive files.. path_to_extract"
call(["WinRAR"] + cmdlineargs.split())

Note in the second line you will need to use the correct command line arguments, the ones above are just as an example.

Holy Mackerel
  • 3,259
  • 1
  • 25
  • 41
  • Thanks for the info. However, I would like to use the WinRar Command line and the syntax is something like below WinRAR - - <@listfiles...> I would want to make use of WinRar for my archiving options as it supports even .exe format. But I am confused around calling the above syntax using from Python. – daaredevill Nov 25 '13 at 18:56
  • @user3023515 I have modified the answer to fit the syntax you describe. – Holy Mackerel Nov 25 '13 at 19:18