????SFX???????????

Aspose.Zip???????????(SFX)????????????? ?????????zipted??????fileName???????????????????????????????????

???????????

????????????????? ??????????????????? archivesaveoptions??????

1try(fileoutputStream zipfile = new fileoutputStream( "archive.exe")){
2    try(archive archive = new archive()){
3        archive.createentry( "entry.bin"??? "data.bin");
4        ArchivesAveOptions options = new archivesaveoptions();
5        options.setselfextractoroptions(new selfextractoroptions());
6        archive.save(zipfile?options);
7    }
8} catch(ioException ex){
9}

????????????

????????????????????????.NET???????2.0???????????????????????Windows Vista???????????? ????????????????????????????????????????????????????????? ??????????? -autoextract???????????????????????????:

1C:\>archive.exe -autoExtract -password:T0p$ecret

??????????????????????

OptionMeaningSample
-autoExtract

Primary option - without it decompression does not start.

Extraction starts automatically, other options apply.

sfx.exe -autoExtract
-autoCloseWindow closes when the extraction is complete. This option only makes sense if -autoExtract option is present.sfx.exe -autoExtract -autoClose
-forceOverwriteOverwrites all existing files without prompt if there are any. This option only makes sense if -autoExtract option present.sfx.exe -autoExtract -forceOverwrite
-password:

Provides a password to encrypted entries. This option only makes sense if -autoExtract option is present.

If you have spaces within the password quote it.

sfx.exe -autoExtract -password:T0p$ecret
-destination:

Extracts files to the supplied directory. This option only makes sense if -autoExtract option is present.

If you have spaces within the path quote it.

sfx.exe -autoExtract -destination:"C:\My Documents"

???????????????Windows?????????????????

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.