cramaboule

Ninite-Silent

19 posts in this topic

#1 ·  Posted (edited)

There is a great tool called ninite (www.ninite.com)

 

The only problem is that it is not really 'silent'

 

So I wrote this little script to make it silent (like /S or /Silent or /quiet)

 

Just rename the downloaded 'Ninite ....... exe' into 'Ninite.exe' and place it into the same folder as the Ninite-silent.exe (my AutoIt prg) Run it and that's it !

 

Link to my au3 and zip files here

Also available here

Enjoy

 

Cramaboule!

EDIT: Change link website!

Edited by cramaboule
Add new link!
1 person likes this

Share this post


Link to post
Share on other sites



Thanks, this is exactly what I was looking for!

Share this post


Link to post
Share on other sites

cramaboules site seems to be down - Does anyone have a mirror of this script? Thanks.

Share this post


Link to post
Share on other sites

I am inside a domain and i need to use the function RunAs. If I replace the shellexecute function for RunAs it is not working properly. Does anyone know to get this fixed?

Share this post


Link to post
Share on other sites

Perhaps instead of using RunAs in the script in the script (which may make the process ran as a different user to the script), try running the script as  "Run as Administrator" or "Run as different user" as shows under Win7 in the context menu. The latter may need the shift key held down while initiating the context menu. I have not used ninite though would expect it needs to have admin privileges to do the installs.
 
If you want RunAs in your script, then try restarting the script with RunAs.

Perhaps this may do it. You may need to change details for the RunAs function.

If Not $CMDLINE[0] Then
    RunAs('username', 'domain', 'password', logon_flag, '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart')
    If @error Then MsgBox(0x30, @ScriptName, 'Failed RunAs')
ElseIf $CMDLINE[1] = '/restart' Then
    ShellExecute('"' & @ScriptDir & '\Ninite.exe"')
    If @error Then
        MsgBox(0x30, @ScriptName, 'Failed to execute "' & @ScriptDir & '\Ninite.exe"')
        Exit 1
    EndIf
    ;
    While 1
        If Not ProcessExists('Ninite.exe') Then Exit 1
        WinSetTrans ( "Preparing", "", 0 )
        WinSetTrans ( "Ninite", "", 0 )
        $text = WinGetText("Ninite", "")
        If StringInStr($text, "Finished.",1) Then
            ExitLoop
        EndIf
        Sleep(500)
    WEnd
    Sleep(1000)
    ControlClick("Ninite", "", "[ID:2]")
Else
    MsgBox(0x30, @ScriptName, 'Only /restart parameter is accepted')
EndIf

:)

Share this post


Link to post
Share on other sites

WinSetState("Example", @SW_HIDE)
Rather than changing the transparency, if you change the visibility of the window to hidden, it will remove the taskbar icon.

*Just a thought.

 

I've tried this in the past, Ninite detects this and shows itself again.

Share this post


Link to post
Share on other sites

Thanks MHz,

That works like a charm!

Share this post


Link to post
Share on other sites

Jorin,

That is awesome. Thanks for letting me know. :)

Share this post


Link to post
Share on other sites

I've tried this in the past, Ninite detects this and shows itself again.

 

Smart. Looks like you've headed in the right direction, then. :)

Share this post


Link to post
Share on other sites

Damn those students are annoying! The reason I dont want to show ninite running is that there is a link to the website in the program. And when they click on that link they use my credentials for the internet. So they can youtube facebook etc. 

Now they already figured out the position of the mouse and that they have to click the link within less then a second before the screen vanishes. If they fail to click it within that second they logoff and try again. 

Is there a way to block mouse input or a way to disable that linkbutton?

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I did this, its not ideal but it works... If anyone knows a better solution, I'm all ears.

If Not $CMDLINE[0] Then
    RunAs('username', 'domain', 'password', logon_flag, '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart')
    If @error Then MsgBox(0x30, @ScriptName, 'Failed RunAs')
ElseIf $CMDLINE[1] = '/restart' Then
    ShellExecute('"' & @ScriptDir & '\Ninite.exe"')
    If @error Then
        MsgBox(0x30, @ScriptName, 'Failed to execute "' & @ScriptDir & '\Ninite.exe"')
        Exit 1
    EndIf
    ;
    While 1
        BlockInput(1)
        If Not ProcessExists('Ninite.exe') Then Exit 1
        WinSetTrans ( "Preparing", "", 0 )
        WinSetTrans ( "Ninite", "", 0 )
        $text = WinGetText("Ninite", "")
        If StringInStr($text, "Finished.",1) Then
            ExitLoop
        EndIf
        Sleep(500)
        BlockInput(0)
    WEnd
    Sleep(1000)
    ControlClick("Ninite", "", "[ID:2]")
Else
    MsgBox(0x30, @ScriptName, 'Only /restart parameter is accepted')
EndIf
Edited by Jorin

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Jorin,

That may work. I would put the BlockInput(0) after the WEnd. Keep the BlockInput(1) in the loop or just before the loop may be safer.

Another idea could be to move the window off screen. You cannot click something off screen with the mouse. You can even send the mouse in the opposite direction so that split second would prove to be a challenge for them. The WinWaitDelay set at 10 will make detection quite fast so the move will be almost in an instant.

Removed

See how that works with testing. Perhaps even a mixture of both ideas. :)

I am getting a 403 Forbidden from their site to download the installer so I cannot even check it for myself.

Edit: Use code in next post

Edited by MHz

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I downloaded a Ninite package to test. Seems cookies in my browser was causing the issue with the 403.

The Prepare window is the 1st window to show so that is the one to wait for. The windows will be moved to just outside of the bottom right hand corner of the screen.

; found in @ScriptDir
$installer = 'Ninite.exe'

If Not $CMDLINE[0] Then
    RunAs('username', 'domain', 'password', logon_flag, '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart')
    If @error Then MsgBox(0x30, @ScriptName, 'Failed RunAs', 5)
ElseIf $CMDLINE[1] = '/restart' Then
    Opt('WinWaitDelay', 10)
    ShellExecute('"' & @ScriptDir & '\' & $installer & '"')
    If @error Then Exit MsgBox(0x30, @ScriptName, 'Failed to execute "' & @ScriptDir & '\' & $installer & '"', 5)
    MouseMove(0, 0)
    WinMove(WinWait("Preparing"), "", @DesktopWidth, @DesktopHeight)
    While 1
        If Not ProcessExists($installer) Then Exit 1
        WinSetTrans ("Preparing", "", 0)
        WinSetTrans ("Ninite", "", 0)
        WinMove("Ninite", "", @DesktopWidth + 5, @DesktopHeight + 5)
        WinMove("Preparing", "", @DesktopWidth + 5, @DesktopHeight + 5)
        If WinExists("Ninite", "Finished.") Then ExitLoop
        Sleep(100)
    WEnd
    Sleep(1000)
    ControlClick("Ninite", "Finished.", "Button1")
Else
    MsgBox(0x30, @ScriptName, 'Only /restart parameter is accepted', 5)
EndIf

I did not test BlockInput though you can add them perhaps outside the loop. :)

Edit: changed a WinSetTrans to 0

Edited by MHz

Share this post


Link to post
Share on other sites

Works like a charm... I dont even need to set a blockinput (wich is a annoying feature the way i used it. It completely blocked input and not just for the ninite window)

Share this post


Link to post
Share on other sites

Hi,

the .zip file seems corrupted :(

Share this post


Link to post
Share on other sites
On 30/04/2016 at 10:47 PM, pp2k said:

Hi,

the .zip file seems corrupted :(

Fixed ! :-)

C.

Share this post


Link to post
Share on other sites

#19 ·  Posted

Hi thank you for your program / script

please could someone help me as im looking to see if i can remove the box that open to select the ninite.exe and give it a path to the exe so that it will autorun.

also is there away to get it to run and display the progress

Thank you in advance 

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

  • Similar Content

    • ur
      By ur
      I have a project in eclipse which is created using below options.
      File --> New --> Dynamic web application project..   I have linked the src folder to local GitHub synced folder.   Whenever there is a change in GitHub source files, I need to clean the project (only clean , not clean and build)   Once the clean is completed, I will export the complete project as war file (right click on project folder in eclipse and export --> war )   I didn't find any command line options to eclipse to do this. Any other alternative to automate this in AutoIT.
    • bstjohn
      By bstjohn
      I'm running AutoIT v3.3.14.2 on Windows 10 ver 1511.  The September Cumulative Update from Microsoft has broken the way some third party credential providers work.  You can see more detail here:  https://www.novell.com/support/kb/doc.php?id=7018051
      So I want to automatically and silently remove this update from all our machines.  In Windows 7 I could easily do it with this:
      wusa.exe /uninstall /kb:3185614 /quiet
      But apparently Microsoft has taken away the /quiet switch functionality in Windows 10.   wusa /? will show that the switch is there, but when trying to use it error 87 (invalid parameter) is returned.
      So I relented on that point and decided to run wusa without the quiet switch.  It pops up a child window that prompts for confirmation before uninstalling the update.  Sounds like a perfect job for AutoIT, right?  Except I can't get the button to click, either using ControlClick or ControlSend or Send.  I can select it by sending the {Alt} key to it and it highlights.  But I just can't get it to accept the click or {Enter}.
      I then tried using Powershell and DISM to remove the package, but this is a hotfix and doesn't have a package name, so I can't use dism /remove-package, either.
      Does anybody have any other ideas how this can be done silently?
    • cramaboule
      By cramaboule
      (almoast) Silent Ninite visite ninite.com
      Put the ninite.exe file into the same folder as the silent-ninite.exe.
      Run 'silent-ninite.exe' and 'See' the beauty!!! :-)