Jump to content
Sign in to follow this  
bordomavi

i can't see my false

Recommended Posts

bordomavi

FileInstall("SPTDinst-x86.exe", @TempDir & "\SPTDinst-x86.exe", 1)
If Not FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") Then
    If @OSArch = "X86" Then
        ShellExecuteWait(@TempDir & "\SPTDinst-x86.exe", 'add')
        While 1
            If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") Then
                ProcessClose("SPTDinst-x86.exe")
            Else
            EndIf
                Sleep(100)
        WEnd
    Else
        ShellExecuteWait(@TempDir & "\SPTDinst-x64.exe", 'add')
        While 1
            If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") Then
                ProcessClose("SPTDinst-x64.exe")
            Else
            EndIf
                Sleep(100)
        WEnd
    EndIf
Else
    MsgBox(0x00000010, "Error", "SPTD 1.83 is Allready on your pc", 5)
EndIf
FileDelete(@TempDir & "\SPTDinst-x86.exe")

i want processclose "SPTDinst-x86.exe" when "sptd.sys" create in "System32Drivers" so i use while code but it does not work.

Share this post


Link to post
Share on other sites
bordomavi

some body help me pls

Share this post


Link to post
Share on other sites
guinness

Please don't bump less than 24 hours. People help because they want to and it's free support, so what more do you want.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
bordomavi

Please don't bump less than 24 hours. People help because they want to and it's free support, so what more do you want.

ok sory

Share this post


Link to post
Share on other sites
ripdad

A few things:

1) Why would you need to force-close the install?

2) How would you exit your loop after ProcessClose?

I re-arranged your code a little...

Local $sFile, $sPath

If FileExists(@WindowsDir & '\System32\Drivers\sptd.sys') Then
    MsgBox(0x00000010, 'Error', 'SPTD 1.83 is Allready on your pc', 5)
Else
    If @OSArch = 'X86' Then
        $sPath = @TempDir & '\SPTDinst-x86.exe'
        $sFile = 'SPTDinst-x86.exe'
    Else
        $sPath = @TempDir & '\SPTDinst-x64.exe'
        $sFile = 'SPTDinst-x64.exe'
    EndIf
    FileInstall($sFile, $sPath, 1)
    ShellExecuteWait($sPath, 'add'); <--- you can't go to the next line until this finishes
    ProcessClose($sFile)
    FileDelete($sPath)
EndIf
Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
bordomavi

 

A few things:

1) Why would you need to force-close the install?

2) How would you exit your loop after ProcessClose?

I re-arranged your code a little...

Local $sFile, $sPath

If FileExists(@WindowsDir & '\System32\Drivers\sptd.sys') Then
    MsgBox(0x00000010, 'Error', 'SPTD 1.83 is Allready on your pc', 5)
Else
    If @OSArch = 'X86' Then
        $sPath = @TempDir & '\SPTDinst-x86.exe'
        $sFile = 'SPTDinst-x86.exe'
    Else
        $sPath = @TempDir & '\SPTDinst-x64.exe'
        $sFile = 'SPTDinst-x64.exe'
    EndIf
    FileInstall($sFile, $sPath, 1)
    ShellExecuteWait($sPath, 'add'); <--- you can't go to the next line until this finishes
    ProcessClose($sFile)
    FileDelete($sPath)
EndIf

Because i want close "Finish installation window"  after install. and your code is not working. it not processclose SPTDinst-x86.exe

Share this post


Link to post
Share on other sites
bordomavi

you told "you can't go to the next line until this finishes" i know this. so i wrote :

While 1
            If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") Then
                ProcessClose("SPTDinst-x86.exe")
            Else
            EndIf
                Sleep(100)
        WEnd

but it didn't work too

Edited by bordomavi

Share this post


Link to post
Share on other sites
FireFox

Hi,

Since you're using the ShellExecuteWait the proccess can not exist after the function, or it launches another instance of itself?

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
bordomavi

Hi,

Since you're using the ShellExecuteWait the proccess can not exist after the function, or it launches another instance of itself?

Br, FireFox.

hi. when i use shellexecutewait with silent parameter it says "fisihed installation" but SPTDinst-x86.exe running already so it is can't run nex line. so i build while code. i wrote previous comments.

Edited by bordomavi

Share this post


Link to post
Share on other sites
ripdad

you told "you can't go to the next line until this finishes" i know this. so i wrote :

While 1
            If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") Then
                ProcessClose("SPTDinst-x86.exe")
            Else
            EndIf
                Sleep(100)
        WEnd

but it didn't work too

 

But you see... it's stuck there (at that line) until the program exits with ShellExecuteWait.

Here, try this...

Local $sFile, $sPath, $nCount = 0, $sSptd = @WindowsDir & '\System32\Drivers\sptd.sys'

If FileExists($sSptd) Then
    MsgBox(0x00000010, 'Error', 'SPTD 1.83 is Allready on your pc', 5)
Else
    If @OSArch = 'X86' Then
        $sPath = @TempDir & '\SPTDinst-x86.exe'
        $sFile = 'SPTDinst-x86.exe'
    Else
        $sPath = @TempDir & '\SPTDinst-x64.exe'
        $sFile = 'SPTDinst-x64.exe'
    EndIf
    FileInstall($sFile, $sPath, 1)
    ShellExecute($sPath, 'add')
    While 1
        Sleep(1000)
        If FileExists($sSptd) Then
            ProcessClose($sFile)
            FileDelete($sPath)
            ExitLoop
        EndIf
        $nCount += 1
        If $nCount > 5 Then; <-- 5 second failsafe
            ExitLoop
        EndIf
    WEnd
EndIf

edit: silly editor - fixed endif

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
bordomavi

But you see... it's stuck there (at that line) until the program exits with ShellExecuteWait.

Here, try this...

Local $sFile, $sPath, $nCount = 0, $sSptd = @WindowsDir & '\System32\Drivers\sptd.sys'

If FileExists($sSptd) Then
    MsgBox(0x00000010, 'Error', 'SPTD 1.83 is Allready on your pc', 5)
Else
    If @OSArch = 'X86' Then
        $sPath = @TempDir & '\SPTDinst-x86.exe'
        $sFile = 'SPTDinst-x86.exe'
    Else
        $sPath = @TempDir & '\SPTDinst-x64.exe'
        $sFile = 'SPTDinst-x64.exe'
    EndIf
    FileInstall($sFile, $sPath, 1)
    ShellExecute($sPath, 'add')
    While 1
        Sleep(1000)
        If FileExists($sSptd) Then
            ProcessClose($sFile)
            FileDelete($sPath)
            ExitLoop
        EndIf
        $nCount += 1
        If $nCount > 5 Then; <-- 5 second failsafe
            ExitLoop
        EndIf
    WEnd
EndIf

edit: silly editor - fixed endif

yes it is working but i have a new problem. sptd.sys created in windowsdir and processclose worked but program didnt install. because sptd.sys is creating in windowsdir before insalling program :( 

Share this post


Link to post
Share on other sites
FireFox

hi. when i use shellexecutewait with silent parameter it says "fisihed installation" but SPTDinst-x86.exe running already so it is can't run nex line. so i build while code. i wrote previous comments.

This is where you don't understand that the ShellExecuteWait function won't complete until the target application finishes so the next lines can't be executed.

 

#include <Constants.au3>

If @OSArch = "X86" Then
    FileInstall("SPTDinst-x86.exe", @TempDir & "\SPTDinst-x86.exe", 1)
Else
    FileInstall("SPTDinst-x64.exe", @TempDir & "\SPTDinst-x64.exe", 1)
EndIf

If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 1 Then ;if the driver exists
    Exit MsgBox(BitOR($MB_ICONHAND, $MB_OK), "Error", "SPTD 1.83 is Allready on your pc", 5)
EndIf

ShellExecute(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe", 'add') ;launch the setup
While FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 0 ;wait for the driver to exist
    Sleep(100)
WEnd

FileDelete(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe")
Edit: Added indents.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
ripdad

I'm sure there is a better way.

Again, why do you need to force-close the install?

Is it waiting for a "Ok" button to be pushed?


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
bordomavi

This is where you don't understand that the ShellExecuteWait function won't complete until the target application finishes so the next lines can't be executed.

 

#include <Constants.au3>

If @OSArch = "X86" Then
    FileInstall("SPTDinst-x86.exe", @TempDir & "\SPTDinst-x86.exe", 1)
Else
    FileInstall("SPTDinst-x64.exe", @TempDir & "\SPTDinst-x64.exe", 1)
EndIf

If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 1 Then ;if the driver exists
    Exit MsgBox(BitOR($MB_ICONHAND, $MB_OK), "Error", "SPTD 1.83 is Allready on your pc", 5)
EndIf

ShellExecute(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe", 'add') ;launch the setup
While FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 0 ;wait for the driver to exist
    Sleep(100)
WEnd

FileDelete(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe")
Edit: Added indents.

Br, FireFox.

 

it stops this window it is like "installation finished"

138k.png

Edited by bordomavi

Share this post


Link to post
Share on other sites
bordomavi

I'm sure there is a better way.

Again, why do you need to force-close the install?

Is it waiting for a "Ok" button to be pushed?

yes it is waiting for it. but i want it full silent.

Share this post


Link to post
Share on other sites
FireFox

Try this :

#include <Constants.au3>
 
If @OSArch = "X86" Then
    FileInstall("SPTDinst-x86.exe", @TempDir & "\SPTDinst-x86.exe", 1)
Else
    FileInstall("SPTDinst-x64.exe", @TempDir & "\SPTDinst-x64.exe", 1)
EndIf
 
If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 1 Then ;if the driver exists
    Exit MsgBox(BitOR($MB_ICONHAND, $MB_OK), "Error", "SPTD 1.83 is Allready on your pc", 5)
EndIf
 
ShellExecute(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe", 'add') ;launch the setup
 
WinWait("SPTD setup V1.83 (C) 2004-2012 Duplex Secure Ltd")
 
FileDelete(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe")

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
FireFox

If you want it full silent, the setup may have a silent parameter like /q or /silent.

Edit: Try this :

#include <Constants.au3>
 
If @OSArch = "X86" Then
    FileInstall("SPTDinst-x86.exe", @TempDir & "\SPTDinst-x86.exe", 1)
Else
    FileInstall("SPTDinst-x64.exe", @TempDir & "\SPTDinst-x64.exe", 1)
EndIf
 
If FileExists(@WindowsDir & "\System32\Drivers\sptd.sys") = 1 Then ;if the driver exists
    Exit MsgBox(BitOR($MB_ICONHAND, $MB_OK), "Error", "SPTD 1.83 is Allready on your pc", 5)
EndIf
 
ShellExecuteWait(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe", 'add /q') ;launch the setup
 
FileDelete(@TempDir & "\SPTDinst-" & StringLower(@OSArch) & ".exe")
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
ripdad

Does it reboot after you push the button?


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
bordomavi

If you want it full silent, the setup may have a silent parameter like /q or /silent.

it has not. only has 1 parameter and it is "add" or may be has but i dont know

Edited by bordomavi

Share this post


Link to post
Share on other sites
bordomavi

Does it reboot after you push the button?

i want press ok button affter installation. but i couldnt it. so i built while code with processclose but it didnt work too

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  

×