Sign in to follow this  
Followers 0
field2network

How do I get this semi-automatic installation procedure work?

7 posts in this topic

Hi,
 

after months of not using and not learning AutoIT (yes, I regret this :oops: ) as I wrote enough batch scripts with a length at least one time around the world I now have a big problem with a very special installation routine that forces me to sleepless nights.

Of course I could spend more hours here to search and pick up all informations necessary, which ist what I actually did. But I am running out of time slowly. So I would kindly ask for help and a script example to solve my little problem.

These are the steps which the installation should make:

1.) AutoIT should prompt user to close Microsoft Outlook 2013 with a yes/no button; if yes is selected, the script should go on, if no is the choice, the script should Exit

2.) After clicking "yes" the script should FORCE Outlook to close.

3.) After terminating Outlook, a net use command with different user rights (function user) should copy 3 pictures from a network share to the public user home folder, after that the installer itself which is one Level deeper inside the share. This single file should only be temporary.

4.) The user should be informed that he may not take any keystrokes. The second possibility is to prevent the user from any input

5.) The installer file is an *.exe . Unfortunally, there are NO command line options, so I have to use the AutoIT window script to click "next" and "finish" automatically. Of course, for that Installation is a run as command necessary.

6.) After finishing the Installation, a *.reg file has to be copied from the same network share and be executed silently.

7.) Now the mapped share should be deleted

8.) The user should get an information button that the Installation was successfull. After clicking "OK", Outlook should be started.

My biggest problem is how to set up the user interface and the parameters to terminate Outlook and execute the installer. I already tried some code-snipplets, so I got a elevated command prompt running, but after the status message is displayed and gone (timeout), the keystrokes for mapping the network share runs into Scite.

I expect that this particular problem is much easier as I expect, but I really need fast help.

It would be great if someone out here could share a few minutes for my code snipplets.

Many thanks in advance,

best regards,

Sven

 

Share this post


Link to post
Share on other sites



My problem is that I have no idea how to set up the user interface as I have never done this before.

MsgBox (4096, "Outlook has to be closed",60)

RunAs ("Administrator", "MYDOMAIN", "MYPASSWORD", 2, "cmd.exe")

send "net use I: 192.168..... "PASSWORD" /user: MYDOMAINuser

I am not sure how to go on with this script.

Any idea? Any example?

Share this post


Link to post
Share on other sites

1.) AutoIT should prompt user to close Microsoft Outlook 2013 with a yes/no button; if yes is selected, the script should go on, if no is the choice, the script should Exit

2.) After clicking "yes" the script should FORCE Outlook to close.

3.) After terminating Outlook, a net use command with different user rights (function user) should copy 3 pictures from a network share to the public user home folder, after that the installer itself which is one Level deeper inside the share. This single file should only be temporary.

4.) The user should be informed that he may not take any keystrokes. The second possibility is to prevent the user from any input

5.) The installer file is an *.exe . Unfortunally, there are NO command line options, so I have to use the AutoIT window script to click "next" and "finish" automatically. Of course, for that Installation is a run as command necessary.

6.) After finishing the Installation, a *.reg file has to be copied from the same network share and be executed silently.

7.) Now the mapped share should be deleted

8.) The user should get an information button that the Installation was successfull. After clicking "OK", Outlook should be started.

 

1.) You have it correct already, a MsgBox.

2.) Then (pseudo) If Msgbox = OK/Yes, ProcessClose Outlook, Else Exit

3.) ShellExecuteWait or RunWait net use <parameters>

4.) MsgBox, then BlockInput

5.) RunWait or ShellExecuteWait installation executable.

6.) RegWrite or Run regedit.exe silently

7.) DriveMapDel

8.) Msgbox.

Now, show us what you can try on your own ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Just a little correction on point 2: you have to use

RunAsWait("USERNAME", "DOMAIN", "PASSWORD", 2, @ComSpec & " /c " & 'commandName')

and don't type user and password in commandname

Share this post


Link to post
Share on other sites

Ok, I understand everything after the yes/no choice.

But I regret that I do not know how to use the query correctly. (Sorry, I am not familiar with AutoIT and scripting language outside of the Microsoft world yet)

So

MsgBox(4148,"","",60)

if....

 

Here I have to stop. Could you provide me how to use the correct Syntax "if", "then" and "else" with the yes/no buttons?

Thanks in advance!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$choice = MsgBox(4096 + 48 + 4,"","",60)
If $choice = 6 Then
    ConsoleWrite("Yes" & @CRLF)
Else
    ConsoleWrite("No" & @CRLF)
EndIf

Edited by j0kky

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