Jump to content
Sign in to follow this  
goldenix

Turn off error checking when Compile

Recommended Posts

Hi.

I want the user to specify the image path & where to save the image ( then the prog will loop the folder & add to exe all images )

see the problem is, that this works theoretically fine. i men in the F5 test mode, but when i compile, it says, that it cant find the files to write to file. I understand, why it cant find the files, but this is unimportant, because they will be defined once the user runs the exe....but i cant compile, maybe someone know a solution?

;~ =================================================================================
; Choose skin foder?
;~ =================================================================================
$browsefolder_ = FileOpenDialog('Choose the Skin folder to read skins from', @ScriptDir & "\", "Select Skin.dat from Folder & Press OPEN(*.dat;*.bmp)", 1 ,'Skin.dat')
If @error then Exit
$a_ = StringSplit($browsefolder_,"\",0)
$_Skin_Folder_o = StringReplace($browsefolder_,$a_[$a_[0]], "")

;~ =================================================================================
; Where Should We write the Temp skin folder?
;~ =================================================================================
$browsefolder = FileSaveDialog('Choose the folder to save temp skin folder', @ScriptDir & "\", "Select temp Skin dir & Press SAVE(x.x)", 1 ,'Select temp Skin dir & Press SAVE')
If @error then Exit
$a = StringSplit($browsefolder,"\",0)
$Temp_Skin_folder_s = StringReplace($browsefolder,$a[$a[0]], "")

;~ =================================================================================
; Search folder for skins & install them
;~ =================================================================================
$search_handle = FileFindFirstFile($_Skin_Folder_o & '*.*')  
If $search_handle = -1 Then
    MsgBox(0, "Error", "Cant Find the" & $search_handle)
    Exit
EndIf

While 1
    $file_found = FileFindNextFile($search_handle) 
    If @error Then ExitLoop ; if no files found exit

    If StringInStr($file_found,'.bmp') Or StringInStr($file_found,'.dat') Then ; if find files we want to binarywrite..
 
    FileInstall($_Skin_Folder_o & $file_found, $Temp_Skin_folder_s & $file_found)
EndIf
WEnd
FileClose($search_handle)
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

Turn the FileInstall line into a /AutoIt3ExecuteLine line.

Edit: Take a look at this code for ideas...

http://www.autoitscript.com/forum/index.php?showtopic=22531

umm why isnt this working? i mean the msgbox does jump out, but the file isnt being copied. Thats wierd..., since they are identical

$title_ = 'C:\0.bmp'
$text_ ='C:\1.bmp'

_FileInstall($title_, $text_)

Func _FileInstall($title, $text)
    Local $pid, $pos
    
    $pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"MsgBox(0x0,''' & $title & ''',''' & $text & ''')"') ; this works
    
    $pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"FileInstall(''' & $title & ''',''' & $text & ''')"')

ProcessWaitClose($pid)
EndFunc

Run(@AutoItExe & ' /AutoIt3ExecuteLine  "MsgBox(0, ''Hello World!'', ''Hi!'')"') ; this works

Run(@AutoItExe & ' /AutoIt3ExecuteLine  "FileInstall(''C:\0.bmp'', ''C:\1.bmp'')"')
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

umm why isnt this working? i mean the msgbox does jump out, but the file isnt being copied. Thats wierd..., since they are identical

$pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & '"FileInstall(''' & $title & ''',''' & $text & ''')"')
In my testing, FileInstall didn't work from an AutoIt3ExecuteLine command.

I haven't seen the sourcecode, but I think it has to do with the conversion to a resource at compile-time.

If a script isn't compiled, the interpreter will use FileCopy instead.

Since the files exist outside of the compiled script, why not just use FileCopy?


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

In my testing, FileInstall didn't work from an AutoIt3ExecuteLine command.

I haven't seen the sourcecode, but I think it has to do with the conversion to a resource at compile-time.

If a script isn't compiled, the interpreter will use FileCopy instead.

Since the files exist outside of the compiled script, why not just use FileCopy?

I want to make the Ezskin, alias XSkin to write the skin pictures into the exe (this way I can run my compilied exe anywhere & the skin folder isnt required anymore in the exe folder) this is wy i must write the files into the exe.

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

I want to make the Ezskin, alias XSkin to write the skin pictures into the exe (this way I can run my compilied exe anywhere & the skin folder isnt required anymore in the exe folder) this is wy i must write the files into the exe.

OK, in that case I would suggest a secondary script that identifies the files, generates the FileInstall lines, and inserts them into your main script before compiling.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

I wanted to use install, since its only 1 line of code, but if this is bugged it cant be helped, Ill just use the script by Farby. Tthanx for the replays.

;~ =================================================================================
; Convert files to binary by Fabry.
;~ =================================================================================
$file = FileOpenDialog('Open the image file', @ScriptDir, 'image (*.jpg;*.xm;*dll;*.png)', 1)
$file2 = FileSaveDialog('Save the file', @ScriptDir, 'script (*.au3)')
_CheckExt($file2, 'au3')
$var = InputBox('Name variable', 'Prompt the name variable used', '$pic')
_CheckCapital($var, '$')
$hfile = FileOpen($file, 16)
$hfile2 = FileOpen($file2, 2)
FileWrite($hfile2, $var&'="0x"' & @CRLF)
While 1
   
    $data = FileRead($hfile, 30)
    If @error Then ExitLoop
    FileWrite($hfile2, $var&'&="' & StringTrimLeft($data,2) & '"' & @CRLF)
WEnd
MsgBox(0, 'Done!!', 'Done by Fabry!!!')
Func _CheckExt(ByRef $s_file, $s_ext)
    If StringRight($s_file, StringLen($s_ext)) <> $s_ext Then $s_file &= '.' & $s_ext
EndFunc   ;==>_CheckExt
Func _CheckCapital(ByRef $s_file, $s_cap)
    If StringLeft($s_file, StringLen($s_cap)) <> $s_cap Then $s_file = $s_cap & $s_file
EndFunc   ;==>_CheckExt
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

umm why isnt this working?...

From the help file under FileInstall:

The source path of the file to compile. This must be a literal string; it cannot be a variable.

You cannot use a variable in the compiled version.

Now that I think about it a bit more, you don't need a secondary script;

You can do a file install to a temp location...

Then copy them to the location indicated by the user of the script.

...or maybe I don't get what you are attempting to do.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

...or maybe I don't get what you are attempting to do.

I assume $userdefined_skinfolder is variable? is there any chance, that variables can be used in Fileinstall future autoit releases?

to come back to /AutoIt3ExecuteLine. I read the help file, but it confused me even more, so let me ask , can i run include with it. I tried & it does not seem to be working, i still cant compile due an error:

ERROR: can't open include file <_temp_skins_in_binary.au3>

#include '_temp_skins_in_binary.au3'

Run(@AutoItExe & ' /AutoIt3ExecuteLine  "#include"'"_temp_skins_in_binary.au3"'""'); this is not working.

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

s there any chance, that variables can be used in Fileinstall future autoit releases?

No.

Look for the resource post by Zedna in the Example Script forum.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

I assume $userdefined_skinfolder is variable?...

Well, yes it is - but I do not see that variable in your OP code.

The AutoIt3ExecuteLine switch takes one line of code and executes it as a totally separate script. AutoIt3ExecuteScript runs an additional script. Both use the AutoIt exe from your main script to run the line or script.

The example that I pointed you to has the main script write a temporary text file and then the main script runs that text file as a script. Now that I've had a bit more time to look over the code in your OP, I see where SmOke_N's suggestion is the route that you need to take. :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Well, yes it is - but I do not see that variable in your OP code.

The AutoIt3ExecuteLine switch takes one line of code and executes it as a totally separate script. AutoIt3ExecuteScript runs an additional script. Both use the AutoIt exe from your main script to run the line or script.

The example that I pointed you to has the main script write a temporary text file and then the main script runs that text file as a script. Now that I've had a bit more time to look over the code in your OP, I see where SmOke_N's suggestion is the route that you need to take. :-)

I still cant understand anything, but im working on it, looks like examples arent working all i see is blanks.....anyway thanx. im going to switch to that topic now.

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...