Jump to content

Silent script ?


patlal
 Share

Recommended Posts

Hi,

I would like to know if there a way to run an autoit script silently. Let me explain. I created a script for installing an application automatically (unattended install). That's work fine, but I still see the windows during the install process. I would like to have something really silent. I tried some macros like @SW_HIDE or @SW_SHOWMINIMIZED but it doesn't work. I am sure that's possible but I can't find how :graduated:

Any help will be welcome.

Thanks,

Patrice

Link to comment
Share on other sites

I have not test winmove but following a post on this forum I tried this (see code below) It works well but I still windows despite the @SW_HIDE. What did I miss ?

#region ---Au3Recorder generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('C:\Users\pat\Downloads\prey-0.4.4-win.exe')

WinWait("Prey 0.4.4 Installer","Welcome to the Prey ")

WinSetState("Prey 0.4.4 Installer","Welcome to the Prey ", @SW_HIDE)

ControlClick("Prey 0.4.4 Installer","Welcome to the Prey ","Button2")

ControlClick("Prey 0.4.4 Installer ","Prey 0.4.4 Installer","Button2")

ControlClick("Prey 0.4.4 Installer ","Prey 0.4.4 Installer","Button2")

ControlClick("Prey 0.4.4 Installer ","Prey 0.4.4 Installer","Button2")

While ControlGetText("Prey 0.4.4 Installer ","Completing the Prey ", "Button2") <> "&Finish"

Sleep(10)

WEnd

ControlClick("Prey 0.4.4 Installer ","Completing the Prey ","Button4")

ControlClick("Prey 0.4.4 Installer ","Completing the Prey ","Button2")

#endregion --- Au3Recorder generated code End ---

Link to comment
Share on other sites

You can easily do a silent install if your app supports command line switches. On many installers, using the /q switch will do a silent install

Indeed and I can say I know pretty well the different silent switches from all the installers (msi, NSIS, Nullsoft etc.) but some softwares doesn't allow silent install or some others doesn't react well, as for Prey where the silent switch works not so good.

Thanks anyway :graduated:

Patrice

Link to comment
Share on other sites

It's a NSIS Installer

So, try the switch /S :graduated:

As I said in a precedent post the ilent switch /S for Prey doesn't work well.It install Prey silently but after that you've got nothing (no shortcuts) to start the config except going in Program Files\Prey\... etc and lauching manually the config.

Thanks anyway.

Patrice

Link to comment
Share on other sites

maybe its something with the userrights.

try to start your script with

#requireadmin

and see if now the sw_hide works correctly.

Seems to be a good idea, but it doesn't change the fact that I can see the windows during the installation process.

Good try :graduated:

Thanks,

Patrice

Link to comment
Share on other sites

It's normal if you don't find any shorcut after install !

read the faq : http://preyproject.com/faq

I installed Prey but I can’t find any icon to launch it. Is something wrong?

The reason you’re not seeing anything is because Prey is made that way, so that the thief won’t be able to detect it.

The best way to check if everything is fine is to log into your Control Panel (through the link sent to your email) and make sure your device’s status is OK.

You can also mark it as missing and enable some of the report modules to see how it will work in real action.

Once you get a report, you can safely delete it and set back the status from missing to OK.

use FileCreateShortcut to add a shortcut ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

It's normal if you don't find any shorcut after install !

read the faq : http://preyproject.com/faq

use FileCreateShortcut to add a shortcut ! Posted Image

Yes, I saw that. But when you make a normal install (without using the silent switch /S), once the install is finished you can find a folder Prey if you click on the "Windows Start" button, then click on "AllPrograms" and then scroll down to the Prey Folder (where you find 2 entries, one for config the other for uninstalling Prey). If you make a silent install, you've got ... nada :graduated: Actually, I was not clear when I was talking about shortcuts. As you certainly noticed, english is not my first language.

Anyway, I would like to find a way with autoIt because it will be very useful for some others programs. I know that I am very close, but I just don't understand what's wrong.

Thanks for your help,

Patrice

Link to comment
Share on other sites

Don't worry about shortcut, try like this :

$_PreySetupPath = @DesktopDir & '\prey-0.4.4-win.exe'
RunWait ( $_PreySetupPath & ' /S' )
_CreateShortcut ( @ProgramsDir, 'Configure Prey', @HomeDrive & '\Prey\platform\windows\prey-config.exe', 'Prey by Pat' ) 
_CreateShortcut ( @ProgramsDir, 'Uninstall', @HomeDrive & '\Prey\platform\windows\Uninstall.exe', 'Prey by Pat' ) 

Func _CreateShortcut ( $_ShortcutDir, $_LnkTitle, $_FilePath, $_FolderName='', $_Parameters='', $_IconPath='', $_IconNumber='' ) 
    If $_FolderName <> '' Then 
        DirCreate ( $_ShortcutDir & "\" & $_FolderName )
        $_FolderName = $_FolderName & "\"
    EndIf
    $_LnkPath = $_ShortcutDir & "\" & $_FolderName & $_LnkTitle 
    If Not FileExists ( $_IconPath ) Or $_IconNumber ='' Then $_IconPath = $_FilePath 
    $_WorkingPath = StringLeft ( $_FilePath, StringInStr ( $_FilePath, "\", 0, -1 ) - 1 )
    If @error Then $_WorkingPath = ''
    FileCreateShortcut ( $_FilePath, $_LnkPath, $_WorkingPath, $_Parameters, "", $_IconPath, "n", $_IconNumber, @SW_SHOWNORMAL ) 
EndFunc ;==> _CreateShortcut ( )

moi non plus, english is not my first language. Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Don't worry about shortcut, try like this :

$_PreySetupPath = @DesktopDir & '\prey-0.4.4-win.exe'
RunWait ( $_PreySetupPath & ' /S' )
_CreateShortcut ( @ProgramsDir, 'Configure Prey', @HomeDrive & '\Prey\platform\windows\prey-config.exe', 'Prey by Pat' ) 
_CreateShortcut ( @ProgramsDir, 'Uninstall', @HomeDrive & '\Prey\platform\windows\Uninstall.exe', 'Prey by Pat' ) 

Func _CreateShortcut ( $_ShortcutDir, $_LnkTitle, $_FilePath, $_FolderName='', $_Parameters='', $_IconPath='', $_IconNumber='' ) 
    If $_FolderName <> '' Then 
        DirCreate ( $_ShortcutDir & "\" & $_FolderName )
        $_FolderName = $_FolderName & "\"
    EndIf
    $_LnkPath = $_ShortcutDir & "\" & $_FolderName & $_LnkTitle 
    If Not FileExists ( $_IconPath ) Or $_IconNumber ='' Then $_IconPath = $_FilePath 
    $_WorkingPath = StringLeft ( $_FilePath, StringInStr ( $_FilePath, "\", 0, -1 ) - 1 )
    If @error Then $_WorkingPath = ''
    FileCreateShortcut ( $_FilePath, $_LnkPath, $_WorkingPath, $_Parameters, "", $_IconPath, "n", $_IconNumber, @SW_SHOWNORMAL ) 
EndFunc ;==> _CreateShortcut ( )

moi non plus, english is not my first language. Posted Image

Between french merci beaucoup :graduated: I won't have anymore time today but I will test that tomorrow for sure. That's very kind of you.

Bon, finalement, je n'ai pas pu m'empêcher de tester... It works perfectly :( Thank you so much.

Patrice

Edited by patlal
Link to comment
Share on other sites

  • 3 years later...

Hi patlaland wakillon, my laptop was stolen but I have access by logmein and I need to run a scritp like you told above. Please could you let me know the whole scritp to install and register silently Prey project? One more thing, if UAC is enabled, is there a way to install Prey script without any prompt from UAC?

Salut Seeker et Tiny Outils Coder, mon portable a été volé mais je n'ai accès par LogMeIn et j'ai besoin d'exécuter un scritp comme vous avez dit ci-dessus. Pourriez-vous m'indiquer l'ensemble scritp pour installer et enregistrer silencieusement projet Prey? Une dernière chose, si l'UAC est activé, est-il un moyen d'installer le script de Prey sans aucune demande de confirmation de l'UAC?

English and French are not my 1st language too.

Thanks so much!!

Edited by azazelcrack
Link to comment
Share on other sites

  • Moderators

azazelcrack,

While I sympathise with your predicament, there is no way we are going to discuss silently installing Prey. Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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