Jump to content

Recommended Posts

Posted

I am having an issue where if I am on an xp machine, it is still executing the else of the win_7 argument. Guidance would be appreciated.

If @OSVersion = "WIN_VISTA" or "WIN_7" or "WIN_2008" or "WIN_2008R2" Then
    If FileExists (@UserProfileDir & "\AppData\Roaming\BOXEE") Then
        ProgressOn("BOXEE Portable", "", "Starting up, please wait...")
        DirMove (@UserProfileDir & "\AppData\Roaming\BOXEE", @UserProfileDir & "\AppData\Roaming\BOXEE_INSTALLED")
        DirCopy (@ScriptDir & "\BOXEE_USERNAME_DATA", @UserProfileDir & "\AppData\Roaming\BOXEE")
        ProgressOff ( )
        RunWait (@ScriptDir & "\BOXEE.exe")
        ProgressOn("BOXEE Portable", "", "Cleaning up, please wait...")
        DirCopy (@UserProfileDir & "\AppData\Roaming\BOXEE", @ScriptDir & "\BOXEE_USERNAME_DATA", 1)
        ProgressSet( 100 )
        DirRemove (@UserProfileDir & "\AppData\Roaming\BOXEE", 1)
        ProgressSet( 66 )
        DirMove (@UserProfileDir & "\AppData\Roaming\BOXEE_INSTALLED", @UserProfileDir & "\AppData\Roaming\BOXEE")
        ProgressSet( 100 )
        sleep (2000)
        ProgressOff ( )
    Else
        ProgressOn("BOXEE Portable", "", "Starting up, please wait...")
        DirCopy (@ScriptDir & "\BOXEE_USERNAME_DATA", @UserProfileDir & "\AppData\Roaming\BOXEE")
        ProgressSet ( 100 )
        ProgressOff ( )
        RunWait (@ScriptDir & "\BOXEE.exe")
        ProgressOn("BOXEE Portable", "", "Cleaning up, please wait...")
        DirCopy (@UserProfileDir & "\AppData\Roaming\BOXEE", @ScriptDir & "\BOXEE_USERNAME_DATA", 1)
        ProgressSet( 50 )
        DirRemove (@UserProfileDir & "\AppData\Roaming\BOXEE", 1)
        ProgressSet( 100 )
        sleep (2000)
        ProgressOff ( )
        EndIf
        
ElseIF @OSVersion = "WIN_XP" or "WIN_XPe" or "WIN_2003" Then

    If FileExists (@UserProfileDir & "\Application Data\BOXEE") Then
        ProgressOn("BOXEE Portable", "", "Starting up, please wait...")
        DirMove (@UserProfileDir & "\Application Data\BOXEE", @UserProfileDir & "\Application Data\BOXEE_INSTALLED")
        DirCopy (@ScriptDir & "\BOXEE_USERNAME_DATA", @UserProfileDir & "\Application Data\BOXEE")
        ProgressOff ( )
        RunWait (@ScriptDir & "\BOXEE.exe")
        ProgressOn("BOXEE Portable", "", "Cleaning up, please wait...")
        DirCopy (@UserProfileDir & "\Application Data\BOXEE", @ScriptDir & "\BOXEE_USERNAME_DATA", 1)
        ProgressSet( 100 )
        DirRemove (@UserProfileDir & "\Application Data\BOXEE", 1)
        ProgressSet( 66 )
        DirMove (@UserProfileDir & "\Application Data\BOXEE_INSTALLED", @UserProfileDir & "\Application Data\BOXEE")
        ProgressSet( 100 )
        sleep (2000)
        ProgressOff ( )
    Else
        ProgressOn("BOXEE Portable", "", "Starting up, please wait...")
        DirCopy (@ScriptDir & "\BOXEE_USERNAME_DATA", @UserProfileDir & "\Application Data\BOXEE")
        ProgressSet ( 100 )
        ProgressOff ( )
        RunWait (@ScriptDir & "\BOXEE.exe")
        ProgressOn("BOXEE Portable", "", "Cleaning up, please wait...")
        DirCopy (@UserProfileDir & "\Application Data\BOXEE", @ScriptDir & "\BOXEE_USERNAME_DATA", 1)
        ProgressSet( 50 )
        DirRemove (@UserProfileDir & "\Application Data\BOXEE", 1)
        ProgressSet( 100 )
        sleep (2000)
        ProgressOff ( )
        EndIf

Else
MsgBox(64, "Not Supported", "Sorry, your operating system is not supported.")
EndIF

Exit
Posted

"Or"'s in AutoIt don't work that way, you need complete comparisons between each "or", ala:

If @OSVersion = "WIN_VISTA" or @OSVersion = "WIN_7" or...

I'd suggest...

Switch @OSVersion
    Case "WIN_VISTA", "WIN_7", "WIN_2008", "WIN_2008R2"
        MsgBox(1,"", "Group1: " &@OSVersion)
    Case "WIN_XP", "WIN_XPe", "WIN_2003"
        MsgBox(1,"", "Group2: " &@OSVersion)
    Case Else
        MsgBox(64, "Not Supported", "Sorry, your operating system is not supported.")
EndSwitch
Posted

"Or"'s in AutoIt don't work that way, you need complete comparisons between each "or", ala:

If @OSVersion = "WIN_VISTA" or @OSVersion = "WIN_7" or...

I'd suggest...

Switch @OSVersion
    Case "WIN_VISTA", "WIN_7", "WIN_2008", "WIN_2008R2"
        MsgBox(1,"", "Group1: " &@OSVersion)
    Case "WIN_XP", "WIN_XPe", "WIN_2003"
        MsgBox(1,"", "Group2: " &@OSVersion)
    Case Else
        MsgBox(64, "Not Supported", "Sorry, your operating system is not supported.")
EndSwitch

Thanks, I'm really liking autoit. Worked like a charm.

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
  • Recently Browsing   0 members

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