FileInstall Funktioniert nicht!?

  • Hi,

    Ich habe ein Programm geschrieben, dass in einer Funktion "FileInstall" aufruft:

    [autoit]

    FileInstall("F:\drive.ico", $drive & ".context~\drive.ico")

    [/autoit]

    Ich bekomme beim Compilieren aber immer diesen Error in einer MsgBox:
    Error adding File:

    F:\drive.ico

    Woran kann das liegen?

  • nein..hier zitiert aus der hilfe

    Der Quellpfad der Datei, die eingebunden und kompiliert werden soll. Dieser muss ein reiner String sein; er kann keine Variable sein. Es kann ein relativer Pfad sein (man verwendet .\ oder ..\ in dem Pfad).


    edit, obwohl dort steht ja quellpfad, hm...ich werds mal selber ausprobieren

  • nein..hier zitiert aus der hilfe

    Der Quellpfad der Datei, die eingebunden und kompiliert werden soll. Dieser muss ein reiner String sein; er kann keine Variable sein. Es kann ein relativer Pfad sein (man verwendet .\ oder ..\ in dem Pfad).

    Ja genau: Der Quellpfad!
    ;)

    • Offizieller Beitrag

    Woran kann das liegen?

    Was steht in $drive?

    Und:

    Zitat von AutoIt-Hilfe

    The destination path of the file with trailing backslash if only the directory is used.

    sowie:

    Zitat von AutoIt-Hilfe

    The destination directory path must already exist before this function is called, or the FileInstall will fail, returning 0 and not creating the file, nor path. See DirCreate() for information about creating the directory path.

  • Was steht in $drive?

    Und:

    sowie:

    In $drive steht zum Beispiel C:\ oder D:\ <- Mit Backslash

    "The destination path of the file with trailing backslash if only the directory is used." verstehe ich nicht. Was passiert, wenn nur der pfad benutzt wird?

    "The destination directory path must already exist before this function is called, or the FileInstall will fail, returning 0 and not creating the file, nor path. See DirCreate() for information about creating the directory path." Ich rufe vorher eine DirCreate Funktion auf. Aber darum muss Autoit sich doch erst kümmern, wenn das Programm läuft und nicht beim Compilieren oder?

    Einmal editiert, zuletzt von INFACT (30. Dezember 2009 um 11:30)

  • ganz dämliche idee: existiert F:\drive.ico überhaupt?

    bei mir funktioniert

    [autoit]

    $drive ="C:\"
    dircreate($drive & ".context~\")
    FileInstall("F:\drive.ico", $drive & ".context~\drive.ico")

    [/autoit]

    einwandfrei