-1

i need it to be self extract file and after the user downloads the file to his computer and run the EXE file the installation of the software starts automatically. as can be done with WINZIP and WINRAR.

I tried to use:

http://sevenzipsharp.codeplex.com/

and could not succeed.

I know i can do it with "dotnetzip" but from what I understand it need .net 2.0 for the self extract EXE file and i do not want to be dependent on .NET framwork.

Dany Maor
  • 2,391
  • 2
  • 18
  • 26
  • 2
    `"i do not want to be dependent on .NET framwork"` so why do you tag your question with `c#` and `asp.net`? – balexandre Sep 16 '14 at 10:11
  • Explain "could not succeed", it should be possible to create SFX using that library. Also .NET has a pretty wide install base. Doesn't the application you'll let the user download also run on .NET? – CodeCaster Sep 16 '14 at 10:14
  • I wrote that i want in C# because I want it to work from ASP.NET C# page. but the resulting file should not need .NET. – Dany Maor Sep 16 '14 at 10:23
  • @DanyMaor It's impossible to write anything with ASP.net without depending on .net (unless you want to write a custom engine with for example just the views using the ASP.net syntax or something, but that's crazy). Someone tell me otherwise, if I am wrong. Also, without depending on .net, how will you compile and run your C# app? – Joel Peltonen Sep 16 '14 at 10:25
  • I have a program that I built (Not in C#) the program is in a folder on the server and there are also other files. i want to change one of the files by user request and compile the program again. instead recompile i thought to compress everything into a single EXE file. – Dany Maor Sep 16 '14 at 10:39

1 Answers1

1

You can use a batch command to create the file and check the output for success or failure. Just use a compiled standard version of 7zip and then run the command:

"7z.exe" a -t7z -m0=LZMA -mmt=on -mx5 -sfx7z.sfx -wc:\ParetnDirectoryOfFolder D:\MyNewSelfExtracting.exe D:\Users\Martyn\FolderToBeZipped

Once you have confirmation, you can store the details in a database for retrieval later, or how ever you want the interface to go.

Sorry it's not a coded answer, but from the looks of it, you are very close to completing!

SmithMart
  • 2,731
  • 18
  • 35
  • i need it to run on ASP.NET page and that is why I want to use a DLL library. – Dany Maor Sep 16 '14 at 10:26
  • 1
    I was thinking you can get the page to request the server to do it. I'm guessing the folder is on the server side as you mentioned it should be downloaded. so you can begin this process using the Process class and the server will do the work and then return the finished exe. Apologies if I have misunderstood. – SmithMart Sep 16 '14 at 10:32