Sign in to follow this  
Followers 0
narillo

daemon tools lite

3 posts in this topic

hi guys... i need your help please... i'm try to use this script to automate daemont tools 4.30.1 and remove the daemon tool bar, etc... but it doesn't work properly... what i'm doing wrong?? thanks a million in advance for your help guys..

#cs
AutoIt 3.2 Script slightly based on an old Daemon Tools 4.0 script published at the MSFN.org boards.
Author: Guillermo Miranda Alamo
#ce

; Installer.
$Name = "DAEMON Tools"
$executable = 'daemon4301.exe'
; Default category folder in startmenu.
$group = 'Recorder\Daemon Tools'

; Installation folder in Program Files.
$directory = 'Recorder\Daemon Tools'


; Run the installer.

RunWait($executable & " /S /D=" & @ProgramFilesDir & "\" & $directory,@ScriptDir)


_Desktop('DAEMON Tools.lnk')

; Delete spyware installer.
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","DaemonTools_WhenUSave_Installer")

If FileExists(@ProgramFilesDir & '\' & $directory & '\SetupDTSB.exe') Then
   FileDelete(@ProgramFilesDir & '\' & $directory & '\SetupDTSB.exe')
EndIf
; Kill the spyware process
If ProcessExists("DaemonTools_WhenUSave_Installer.exe")  Then
   ProcessClose("DaemonTools_WhenUSave_Installer.exe")
EndIf
  

; Remove that... Crap
DirRemove(@ProgramFilesDir & '\' & "DaemonTools_WhenUSave_Installer",1)

; Move program menu folder
DirMove ( @ProgramsCommonDir&"\"&$Name, @ProgramsCommonDir&"\"&$group , 1 )


Exit


Func _Desktop($shortcut)
  ; Delete a Desktop shortcut.
    If FileExists(@DesktopDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopDir) And FileDelete($shortcut)
    ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then
        Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut)
    EndIf
EndFunc

Share this post


Link to post
Share on other sites



Welcome to the forum.

I don't have Daemon Tools and I don't have any need for it, so the help I'll be able to give you will be under these conditions.

Your _Desktop function looks a little weird to me - especially "Return" statements.

Func _Desktop($shortcut)

; Delete a Desktop shortcut.

If FileExists(@DesktopDir & '\' & $shortcut) Then

Return FileChangeDir(@DesktopDir) And FileDelete($shortcut)

ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then

Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut)

EndIf

EndFunc

"Return" statement is used usually to pass something back OR to force a return before the function execution comes to a natural end.

In your case "Return" is not justified.

Your function should be:

Func _Desktop($shortcut)
 ; Delete a Desktop shortcut.
    If FileExists(@DesktopDir & '\' & $shortcut) Then
        FileChangeDir(@DesktopDir)
        FileDelete($shortcut)
    ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then
        FileChangeDir(@DesktopCommonDir)
        FileDelete($shortcut)
    EndIf
EndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

I think he does that to consolidate the return values of the individual functions into his own return value as boolean...

It is functionally OKEY DOKEY.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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