Sign in to follow this  
Followers 0
WilliamP

How do I "Extract" file embedded in script via FileInstall

6 posts in this topic

#1 ·  Posted (edited)

I can't seem to figure this one out. as part of a larger install package I wrote to simplfy the installation of a suite of applications we install quite often, there is a utility call SetSecurityApp.exe. This needs to run from the local C drive. I would like to add it to a new compiled script just to run this utility. Rahter than just copyi8ng the file from a location as the script below does, I would like to user "FileInstall" so all I have to have is my compile script executable, but once I use file install how do I "Extract" the SetSecurityApp out of my script to the local C drive? The SetSecurityApp.exe is a small GUI that runs to set security options in Dot Net Framework

BlockInput (1)

;Set Security Application

FileCopy("SetSecurityApp.exe", "C:\")

run("c:\SetSecurityApp.exe")

WinWaitActive("NICE Perform Security Adjustment Tool")

Send ("server name")

Sleep(1000)

WinWaitActive("NICE Perform Security Adjustment Tool")

send ("{TAB}")

send ("{ENTER}")

Sleep (4000)

send ("{TAB}")

send ("{ENTER}")

BlockInput(0)

Edited by WilliamP

Share this post


Link to post
Share on other sites



FileInstall ( "source = where your file is on your hard drive", "dest = where you want it to be extracted to on the computer that's running your script" (optional[, flag 0 = (default) do not overwrite existing files, 1 = overwrite existing files]) )


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Welcome

did you see the FileInstall() Help??

FileInstall ( "source", "dest" [, flag] )

soo

FileInstall("C:\SetSecurityApp.exe",@Scriptdir&"\SetSecurityApp.exe")

then when you compile and execute this in any PC, the SetSecurityApp.exe file will be in the script dir

By. MS999

Edited by monoscout999

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ok I see now. Sorry for being a little slow on the uptake. Thank you for the reponses.

Edited by WilliamP

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sorry I did not make myself clear, I know how to use and script the file install but once I compile the script into an executable how do I copy the SetSecurityApp back out of the script onto the root of C so I can run the script from any location? Sorry for not being specific enough, and thank yo for the reply.

When you write the FileInstall command you put the destination folder.... fileinstall do all the job Edited by monoscout999

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

It does it automatically as soon as you run the script, when it hits the FileInstall function, it extracts to the "dest" location.

From the help file:

Remarks

The FileInstall function is designed to include files into a compiled AutoIt script. These included files can then be "extracted" during execution of the compiled script if the statement is executed. Keep in mind that files such as images can greatly increase the size of a compiled script.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
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
Sign in to follow this  
Followers 0