cgg Posted October 1, 2007 Share Posted October 1, 2007 Could anyone please help me, urgent !!! Hello, I have created a script, when i run it in the scripteditor then everything works fine. But when i compile it to an exe i get the follwing error : "Invalid Fileinstall() function" Link to comment Share on other sites More sharing options...
Developers Jos Posted October 1, 2007 Developers Share Posted October 1, 2007 (edited) 1. what is different with the previous posted thread ? http://www.autoitscript.com/forum/index.ph...tall()+function2. did you search on "Invalid Fileinstall() function" and check the hits to see if that gave any solution ?3. you probably have a variable in the source of FileInstall() but will need the code to be able to understand whats going on .. Edited October 1, 2007 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 More sharing options...
cgg Posted October 1, 2007 Author Share Posted October 1, 2007 1. what is different with the previous posted thread ? http://www.autoitscript.com/forum/index.ph...tall()+function 2. did you search on "Invalid Fileinstall() function" and check the hits to see if that gave any solution ? 3. you probably have a variable in the source of FileInstall() but will need the code to be able to understand whats going on .. #include <GUIConstants.au3> #include <Misc.au3> #include <File.au3> #include <Process.au3> #include <Constants.au3> #include <string.au3> Dim $UserObj DIM $sigpath = ( @AppDataDir &'\microsoft\signatures' ) Dim $msg Dim $msg1 Dim $domain = @LogonDomain ;pulls domain that user is logged into Dim $username = @UserName ;pulls username that is logged in Const $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") ; DNS domain name. $objTrans = ObjCreate("NameTranslate") $objTrans.Init ($ADS_NAME_INITTYPE_GC, "") $objTrans.Set ($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set ($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & @UserName) $strUserDN = $objTrans.Get ($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN) DIM $fullname = $UserObj.FullName DIM $department = $UserObj.Department DIM $Company = $UserObj.Company DIM $description = $UserObj.Description DIM $streetaddress = $UserObj.get("streetAddress") DIM $city = $UserObj.get("l") DIM $state = $UserObj.get("st") DIM $zipcode = $UserObj.PostalCodes DIM $country = $UserObj.get("c") DIM $emailaddress = $UserObj.EmailAddress DIM $officenumber = $UserObj.TelephoneNumber DIM $mobilenumber = $UserObj.TelephoneMobile DIM $faxnumber = $UserObj.FaxNumber DIM $homeMDB = $UserObj.get("homeMDB") Dim $homeMDBtext = StringSplit($homeMDB, ",") Dim $mailboxname = StringTrimLeft($homeMDBtext[4], 3) Dim $salutation = ("Met vriendelijke groet(en),") Dim $Disclaimer1 = ("Disclaimer") Dim $Disclaimer2 = ("-------------------------------------") Dim $Disclaimer3 = ("The information included in this message is personal and/or confidential and intended exclusively for the addressees as stated. This message and/or the accompanying documents may contain confidential information and should be handled accordingly. If you are not the intended reader of this message, we urgently request that you notify Centric immediately and that you delete this e-mail and any copies of it from your system and destroy any printouts immediately. It is forbidden to distribute, reproduce, use or disclose the information in this e-mail to third parties without obtaining prior permission from Centric. We expressly point out that there are risks associated with the use of e-mail. Centric and the companies within the group shall not accept any liability whatsoever for damage resulting from the use of e-mail. Legally binding obligations can only arise for Centric by means of a written instrument, signed by an authorized representative of Centric.") Dim $Disclaimer4 = ("-------------------------------------") Dim $text1 = ("Welcome to the world of Centric") Dim $text2 = ("www.centricstoreworld.com") Dim $Companywebsite = ("www.centric.be") Dim $Defaultsigname = ("test") Dim $sightm = ("centric.htm") Dim $siggif = ("centricgif.htm") Dim $sigtxt = ("centric.txt") If FileExists ( $sigpath &''& $sightm) Then ;checks to see if the htm version of the signature is there returns '1'=exist '0'=does not exist Exit EndIf If FileExists ( $sigpath &''& $siggif) Then ;checks to see if the htm version with a gif image embedded in the signature is there returns '1'=exist '0'=does not exist Exit EndIf If FileExists ( $sigpath &''& $sigtxt) Then ;checks to see if the txt version of the signature is there returns '1'=exist '0'=does not exist Exit EndIf call ("regsig") ;call ("gifsig") call ("textsig") call ("SigRegisty") Func regsig () $filename1 = $sigpath & "\centric.htm" FileInstall(@ScriptDir &"\storeworld.JPG", $sigpath & '\storeworld.JPG') $msg1 &= "<HTML><HEAD><TITLE>Centric Signature</TITLE>"& @CRLF $msg1 &= "<BODY>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $salutation &"</FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $fullname &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $description &"</FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2><IMG alt='' hspace=0 src='"& $sigpath & "\storeworld.JPG' align=baseline border=0></FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $text1 &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2><a href='http://"& $text2 &"'> "& $text2 &"</a></FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $Company &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $streetaddress &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $zipcode &" "& $city &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $country &"</FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>Phone : "& $officenumber &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>Fax : "& $faxnumber &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>Mobile: "& $mobilenumber &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2><a href='mailto:"& $emailaddress &"'> "& $emailaddress &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2><a href='http://"& $Companywebsite &"'> "& $Companywebsite &"</a></FONT></DIV><br>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer1 &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer2 &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer3 &"</FONT></DIV>"& @CRLF $msg1 &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer4 &"</FONT></DIV>"& @CRLF FileWrite($filename1, $msg1 );Writes the text to the html file EndFunc Func gifsig () $filename = $sigpath & "\centricgif.htm" FileInstall(@ScriptDir &"\storeworld.JPG", $sigpath & '\storeworld.JPG') $msg &= "<HTML><HEAD><TITLE>Centric Signature</TITLE>"& @CRLF $msg &= "<BODY>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $salutation &"</FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $fullname &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $description &"</FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2><IMG alt='' hspace=0 src='"& $sigpath & "\storeworld.JPG' align=baseline border=0></FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $text1 &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2><a href='http://"& $text2 &"'> "& $text2 &"</a></FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $Company &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $streetaddress &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $zipcode &" "& $city &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $country &"</FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>Phone : "& $officenumber &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>Fax : "& $faxnumber &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>Mobile: "& $mobilenumber &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2><a href='mailto:"& $emailaddress &"'> "& $emailaddress &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2><a href='http://"& $Companywebsite &"'> "& $Companywebsite &"</a></FONT></DIV><br>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer1 &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer2 &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer3 &"</FONT></DIV>"& @CRLF $msg &= "<DIV align=left><FONT face=Arial size=2>"& $Disclaimer4 &"</FONT></DIV>"& @CRLF FileWrite($filename, $msg );Writes the text to the html file EndFunc Func textsig () ;Text file creation $filename = $sigpath & "\centric.txt" $msg = ""& $salutation & @CRLF $msg &= @CRLF $msg &= @CRLF $msg &= ""& $fullname & @CRLF $msg &= ""& $description & @CRLF & @CRLF $msg &= ""& $text1 & @CRLF $msg &= ""& $text2 & @CRLF & @CRLF $msg &= ""& $Company & @CRLF $msg &= ""& $streetaddress & @CRLF $msg &= ""& $zipcode &" "& $city & @CRLF $msg &= ""& $country & @CRLF & @CRLF $msg &= "Phone : "& $officenumber & @CRLF $msg &= "Fax : "& $faxnumber & @CRLF $msg &= "Mobile:"& $mobilenumber & @CRLF $msg &= ""& $emailaddress & @CRLF $msg &= ""& $Companywebsite & @CRLF & @CRLF $msg &= ""& $Disclaimer1 & @CRLF $msg &= ""& $Disclaimer2 & @CRLF $msg &= ""& $Disclaimer3 & @CRLF $msg &= ""& $Disclaimer4 & @CRLF & @CRLF FileWrite($filename, $msg );Writes the text to the file EndFunc Func SigRegisty ();Changes registry settings for Outlook $var = RegRead ("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail\", "EditorPreference") if $var = 131072 Then Else RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail\", "EditorPreference", "REG_DWORD", "131072");Changes the default format for outgoing messages to HTML EndIf ;Working on adding a string to HEX conversion for the name of the default signature, ;Writes NEW Signature as the default signature (Requires Restart of Outlook to take affect). Set your signature and drill down in the resgistry to find the HEX value for the signature name RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\%profilename%\9375CFF0413111d3B88A00104B2A66760000001", "New Signature", "REG_BINARY", "%HEX Signature name with 00 between each letter and trailing 0000000%") EndFunc ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError Link to comment Share on other sites More sharing options...
Developers Jos Posted October 1, 2007 Developers Share Posted October 1, 2007 Did you check the 3 items I mentioned or do you want us to do the work for you ? Item 3. in my message is the solution ... 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 More sharing options...
cgg Posted October 1, 2007 Author Share Posted October 1, 2007 Did you check the 3 items I mentioned or do you want us to do the work for you ?Item 3. in my message is the solution ...Yes, but I can seem to find the problem Link to comment Share on other sites More sharing options...
Developers Jos Posted October 1, 2007 Developers Share Posted October 1, 2007 Yes, but I can seem to find the problemYou CANNOT have a variable in the source parameter and @ScriptDir is a Macro variable:FileInstall(@ScriptDir &"\storeworld.JPG", $sigpath & '\storeworld.JPG')Just change it to:FileInstall("storeworld.JPG", $sigpath & '\storeworld.JPG') 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 More sharing options...
cgg Posted October 1, 2007 Author Share Posted October 1, 2007 You CANNOT have a variable in the source parameter and @ScriptDir is a Macro variable:FileInstall(@ScriptDir &"\storeworld.JPG", $sigpath & '\storeworld.JPG')Just change it to:FileInstall("storeworld.JPG", $sigpath & '\storeworld.JPG')Thnx it works fine now, thnx a lot Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now