• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

self extracting exe

Hi,

I am trying to automate a process and have been supplied self extracting exe's by a client.  The client will not supply anything else, so I am stuck with this route.

I am trying to find code to open and extract these files and place them into a directory of choice.

I've looked high and low and all the code that seems to be available via search engines involves creating self extracting exe's and not opening them.

Using VB.net 2008.

Any suggestions?

Thanks in advance!
0
pigface
Asked:
pigface
  • 3
  • 3
  • 2
  • +1
1 Solution
 
swapneel_d14Commented:
If it is self extracting Exe Can't you just do Process.Start

Dim startInfo As New ProcessStartInfo("C:\bdw\Vault 2.0\packinglist.exe")
    startInfo.Arguments = "CalledfromMIDAS"
    Process.Start(startInfo)
0
 
LMiller7Commented:
Depending on the type of self extracting exe you may have no choice but to let it extract itself. There is no requirement that these files conform to any established standards, only that they be a valid exe.
0
 
swapneel_d14Commented:
Just use Process.Start(Application path)
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
weirddemonCommented:
I agree with the others. Allow the programs to extract themselves. However, since you're automating a process, you'll need to wait until it ends and then continue on:
0
 
pigfaceAuthor Commented:
Hi Thanks for the feedback.  This is my 1st time to pick up on this thread since the new year.

All seems logical, but how would I specify where the contents get unzipped?  On a self extracting exe, you can specify the destination folder and none of the examples show that.

Thanks again for your help
0
 
weirddemonCommented:
Pigface,

It can be done, but it's not going to be easy. More than likely, what you'd have to do is utilize some Windows APIs and automate the pressing of buttons that way. But that's less than ideal.

However, you can extract the contents of the self-extracting executable and do with them as you wish.

In the past I've used UniExtractor. It has worked well for me in the past.

_http://legroom.net/software/uniextract#download

If you don't want to go this route then I'll come up with a way to extract it.
0
 
pigfaceAuthor Commented:
Apologies for my delay, the UK has had lots of snow and I have been trapped in my very rural house away from work.

I figured it out and I will assign points to Swapneel as he led me in the right direction.

Here is the solution for what it is worth.  NB.  arguments and /auto play a big part in it running.  Also another stumbling block is that if you run this on a shared drive then you will get those annoying pop ups requesting "is it safe to run the exe blah blah blah"

try this to cure that:

http://forums.techarena.in/windows-server-help/427088.htm

    Private Sub UnZipFile(ByVal ZipFile As String, ByVal DestFolder As String)

        Dim StartZip As New Diagnostics.Process

        Try
            StartZip.StartInfo.FileName = """" & ZipFile & """"
            StartZip.StartInfo.Arguments = " /auto " & """" & DestFolder & """"
            StartZip.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
            StartZip.Start()

            StartZip.WaitForExit()
            StartZip.Close()

            Dts.TaskResult = Dts.Results.Success

        Catch ex As Exception
            Dts.TaskResult = Dts.Results.Failure

        Finally
            StartZip = Nothing
        End Try

    End Sub


I think I should assign some points to myself too :)
0
 
pigfaceAuthor Commented:
only a partial answer hence B and I did have a lot of head scratching myself.  I was going to give C, but you did help.
0
 
swapneel_d14Commented:
Well done mate.  Thank yuu for the Points.
But Becuase of snow in uk and transportation mess couldnt punt much time on your thread.
Cheers
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now