Jump to content

FileInstall function


Recommended Posts

Hello guys, what's up everybody?

I'm having a problem on compilation of a script that uses FileInstall function, I've got this script on this post here -> made by joshiieeii a owesome script for creating signatures for Outlook, I didn't want to wake that old topic so I created this one.

This code below I just inserted a quote in the end of the 12th line, it was missing

The error that is presented to me is "Invalid FileInstall() function:", I've tryed to modify the type of quotes on the third line, I read the help about FileInstall function but I didn't find what is wrong with the code, does anyone have a clue? I'd be greatful for any help.

To compile the script I'm using the version v3.3.6.1 of AutoIt.

The attachment file is the downloaded code from the original post.

Func gifsig ()
$filename = $sigpath & "\testgif.htm"
FileInstall(@ScriptDir &"\smalllogo2.gif", $sigpath & '\smalllogo2.gif')
$msg &= "<HTML><HEAD><TITLE>test Signature with GIF</TITLE>"& @CRLF
$msg &= "<BODY>"& @CRLF
$msg &= "<DIV align=left><FONT face=Arial size=2>"& $salutation &"</FONT></DIV>"& @CRLF
$msg &= "<DIV align=left>&nbsp;</DIV>"& @CRLF
$msg &= "<DIV align=left><FONT face=Arial size=2></FONT>&nbsp;</DIV>"& @CRLF
$msg &= "<DIV align=left><FONT size=2><FONT face=Arial><STRONG><FONT" & @CRLF
$msg &= "color=#808080>"& $fullname &"</FONT></STRONG>  <STRONG><FONT " & @CRLF
$msg &= "color=#808080>"& $department &"</FONT></STRONG></FONT></FONT></DIV>" & @CRLF
$msg &= "<DIV align=left><FONT size=2><FONT face=Arial> <STRONG><FONT color=#808080><IMG alt='' hspace=0 src='"& $sigpath & "\smalllogo2.gif' align=baseline border=0></FONT></STRONG></FONT></FONT>"
$msg &= "<DIV align=left><FONT face=Arial size=2><STRONG>T:</STRONG> "& $officenumber &" "& @CRLF
$msg &= " <a href='mailto:"& $emailaddress &"'> "& $emailaddress &"</a>  "& $streetaddress &"  "& $city &", "& @CRLF
$msg &= ""& $state &"&nbsp; "& $zipcode &"&nbsp; "& $country &"</FONT></DIV>"& @CRLF
$msg &= "<DIV align=left><I><FONT face=Arial color=#808080 size=1>"& $Disclaimer &"</FONT></DIV></I></BODY></HTML>"
FileWrite($filename, $msg );Writes the text to the html file
EndFunc

EmailSig.zip

Link to comment
Share on other sites

FileInstall(@ScriptDir &"\smalllogo2.gif", $sigpath & '\smalllogo2.gif')

The source path of the file to compile. This must be a literal string; it cannot be a variable or the result of a function call. It can be a relative path (using .\ or ..\ in the path) to the source file (.au3).

See fileinstall function in helpfile ! Posted Image

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

Link to comment
Share on other sites

  • Developers

That statement is correct as far as syntax.

Show the SciTE output pane info when you use that to compile.

Jos

EDIT: You have some other syntax errors in your attached script.

Install the Full SciTE4AutoIt3 so AU3Check is always ran and give you better error descriptions.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Are you sure that file exists at this path ?

Oh yeah man! It's right there!

The output is this one:

>"C:\Program Files\AutoIt3\SciTE\..\aut2exe\aut2exe.exe" /in "C:\Sign\EmailSig.au3"
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2008
UPX 3.03w       Markus Oberhumer, Laszlo Molnar & John Reiser   Apr 27th 2008

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
    646144 ->    300544   46.51%    win32/pe     EmailSig.exe

Packed 1 file.
>Exit code: 65535    Time: 4.934
Link to comment
Share on other sites

You are allowed to use variables and macros in the target-parameter of FileInstall, only the source must not conatain any variables. The target directory must exist.

$targetdir = @AppDataDir & "\MyApplication"
DirCreate($targetdir)
FileInstall("C:\myfile.txt", $targetdir & "\myfile.txt")

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

You are allowed to use variables and macros in the target-parameter of FileInstall, only the source must not conatain any variables. The target directory must exist.

$targetdir = @AppDataDir & "\MyApplication"
DirCreate($targetdir)
FileInstall("C:\myfile.txt", $targetdir & "\myfile.txt")

Hello ProgAndy

Look what I did now:

Func gifsig ()
$filename = $sigpath & "\testgif.htm"
DirCreate($filename)
FileInstall("C:\EmailSign\smalllogo2.gif", $filename & '\smalllogo2.gif')

Still not working and the debug message that it show is:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\EmailSig\EmailSig.au3" /autoit3dir "C:\Program Files\AutoIt3"
+>16:28:02 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0416  Keyboard:00010416  OS:WIN_7/  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
+>16:28:02 AU3Check ended.rc:0
>Running:(3.3.6.1):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe  /in "C:\EmailSig\EmailSig.au3" /out "C:\EmailSig\EmailSig.exe" /nopack /comp 2
!>16:28:06 Aut2exe.exe ended errors because the target exe wasn't created, abandon build.rc:9999
>Exit code: 0    Time: 4.463
Link to comment
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
 Share

  • Recently Browsing   0 members

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