Jump to content

Application installation


Recommended Posts

I am wanting to create a simple installation of an application

I know how to use the autorecorder and some internal commands, but I was hoping to see if the following items are doable in autoit

can I include the application in the compiled exe, (the RUN command dictates this now) the application might not be at a pre determined location)

Could I build a selection gui to be able to select different application versions x32, x64 as examples, anybody a code example that will help me see this?

any help and direction or example of code is greatly appreciated.

I am using autoit version 3.3.6.1

Thank you

Link to comment
Share on other sites

no gui need, just detect and install the applicable one

If @OSARCH = "X86" Then
    FileInstall ("X86version" , "destination")
    ElseIF @OSArch = "X64" Then
    FileInstall ("X64version" , "destination")
Else
    msgbox (0 , '' , "ummmmmm")
    Exit
    Endif
    
    run ("destination")

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

not sure what should be placed in the run("destination") location

the destination for the x32 and x64 makes since,, but shouldn't each OS have a run statement

Can you fill in the specs as if it was in use for a certain application,, that would be helpful

Thanks

Link to comment
Share on other sites

cant get the au3 file compiled with the 'X86 version' in the code.

it errors saying Error adding file:

X86version

If @OSARCH = "X86" Then

FileInstall ("X86version", "c:\winzipx32.exe")

Run('c:\winzipx32.exe')

ElseIF @OSArch = "X64" Then

FileInstall ("X64version" , "c:\winzipx64.exe")

Run('c:\winzipx64.exe')

Else

msgbox (0 , '' , "InCorrect OS found")

Exit

Endif

any ideas?

Link to comment
Share on other sites

Is the name of the file you're installing called X86version? If not, then it won't FileInstall it. I'm guessing that it refers to the folder that the file is in, and not the actual file name.

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

Link to comment
Share on other sites

see the part where you get to specify the name of the destination file during fileinstall

see the part where both my files get renamed to "destination" regardless of which one is dropped

so I only need a single run statement because "destination" will be the correct file path and name, my script will work as posted provided the filenames are specified as such. Though the 'else' is probably unnecessary, i dont like leaving my statements without something to catch all else.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

yes, ok, I see it now..

fileinstall is the exe to run and destination is assigned a variable to run later..

Thanks

I compile this now and it seem the exe is the size of the application, but it still requires the application to be available in the installfile location for it to run..

I think the use of the x86 vs x64 selection is what I need, I can just make sure the source code in available to choose from and not make it part of the compiled code.

Thank you very much for you help, I know I need a lot more, but this is a good start.

Link to comment
Share on other sites

not a variable, its the destination path.

I'm not quite understanding the last part, but below is an example of how our KBs are deployed

If @OSVersion="WIN_XP" then         ;if OS is xp then...
FileInstall (".\XP\KBs.zip" , "c:\temp1\" , 1)      ;copy the KBs.zip that is in the XP folder relative to the .au3 into c:\temp1
ElseIf @OSVersion="WIN_2008" then                   ;if OS is WIN_2008
    FileInstall (".\SVR\KBs.zip" , "c:\temp1\" , 1) ;install the KBs.zip that is in the SVR folder relative to the .au3 into c:\temp1
Else                            ;if anything but XP or WIN_2008
tooltip ("Operating System not Supported, Exiting." , "" , "" , "KBrunner" , 3 , 4)   ;display a message letting them know the os is not supported
sleep (5000)  ; wait so they can read the message
exit

EndIf

After this, I have c:\temp1\KBs.zip. Which zip archive is deployed depends on the O/S, no need to risk letting the enduser select incorrect options.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Thank you, that is very clear,

Is it better to check OSVersion instead of @OSARch?

I have mine setup like you list and when I compile, the EXE size grows to the combined size of the 2 files in the different fileinstall folders.

not a problem if that is correct.

I am following the code as you list with a Run("destination executable") command to go ahead and install the correct code based on OSVersion

I appreciate the feedback,,

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...