Jump to content

Can I use FileInstall to Pack an file but not extract until I hit a button


Recommended Posts

I want to pack a few files inside my compiled script but not extract them until I hit a GUI button that calls a function to extract the file.

Is this what #Include is for?

Thanks,

MrChris

Edited by MrChris
Link to comment
Share on other sites

  • Moderators

Use something like:

While 1
    $msg = GUIGetMsg()
    If $msg = $buttonToCallRun Then
        FileInstall('C:\whatever\whatever.exe', @TempDir & '\Some.exe')
        Do
            Sleep(10)
        Until FileExists(@TempDir & '\Some.exe')
        Run(@TempDir & '\Some.exe')
    EndIf
WEnd

#include = http://www.autoitscript.com/autoit3/docs/k...rds/include.htm

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks for the reply,

So it looks like it will still extract the FileInstall content to where ever I tell it to? I was only wanting to do this becuase there where a few good size files I wanted to pack inside my compiled exe and I figured if I could only have it extract those files when I hit a button in my GUI it would save some time when opening the main GUI up.

Thanks,

MrChris

Link to comment
Share on other sites

Hi, so, if I have a script that Uninstalls another program, then another script to install a new program (say, a new version of the program I just uninstalled)... I could:

FileInclude("Install.exe", @temp & "Install.exe")

And then write to the registry (HKLM...\Run\"Install.exe"

So that after the Uninstall does a reboot, the Install.exe will pick up where the previous left off and continue to Install...?

Right?

Link to comment
Share on other sites

Ok, one more (last...?) thing, so now that I have Uninstall.exe and Install.exe, can I make them into one .exe with AutoIt? Or should I just accept that it's gonna be two programs?

Thanks in advance...

Link to comment
Share on other sites

You proabably want your install to create the uninstaller no?

In your install script when your installing files just have it install the unistall file also... (that sounds funny but that's what it is :D )

I'm not following.

Or rather, I understand the idea (Make Phase1 (Uninstall.exe), install Phase2 (Install.exe) onto the hdd) but I don't understand how I would do that.

Do I use #install <Install.exe> ; I know that's wrong, I tried... :wacko:

Hmmm, I've just re-read your post. I think might be misunderstanding what I'm trying to do.

I have a bit of standard software (say, and antivirus of some sort) installed on a computer on a network. I have to reinstall that software and apply whatever configuration settings, patches etc. First part of the reinstall, is removing the existing application. This then requires a reboot. Upon logging into windows, the second part of the reinstall takes place - my script installs the application and configures it.

So I have an Uninstall.au3 and an Install.au3.

The Uninstall.exe places the Install.exe in a temp folder, and configures the reg\run settings.

The system reboots, and after login the Install.exe runs.

So far so good, this all seems to be working pretty well.

But, I've got TWO scripts. Can I wrap them up together so that I only have one?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...