Jump to content

Scite gets IOException: rename error: Permission denied when compiling


Recommended Posts

I've uploaded the latest version of Autoit from April 2010. Since then I've been getting this error:

>Running:(3.3.0.0):C:\Program Files\AutoIt3\aut2exe\upx.exe" --best --compress-icons=0 -qq "C:\Tickets\finalsum3.exe"

upx: C:\Tickets\finalsum3.exe: IOException: rename error: Permission denied

Now I can use Aut2exe to compile the executable, but I like to get the compile done from Scite as usual. What can be done to make this work?

Thanks

Link to comment
Share on other sites

  • Moderators

jmosley708,

Firstly, the latest AutoIt version is 3.3.6.1 - so you might want to update again! :P

Now, your error is nothing to do with Autoit, it is when you run upx to compress the compiled exe that you are getting this error - as the error message clearly shows. It seems upx is having problems with renaming.

Do you have an AV running? Or any form of anti-malware? Try compiling with them disabled, or add upx to a list of trusted files and see if that cures the problem. :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I've noticed that this happens quite frequently in Windows 7 when I have the folder open (in Explorer) where the compiling is taking place. If I close explorer or navigate to another directory, the error does not occur.

Link to comment
Share on other sites

jmosley708,

Firstly, the latest AutoIt version is 3.3.6.1 - so you might want to update again! :P

Now, your error is nothing to do with Autoit, it is when you run upx to compress the compiled exe that you are getting this error - as the error message clearly shows. It seems upx is having problems with renaming.

Do you have an AV running? Or any form of anti-malware? Try compiling with them disabled, or add upx to a list of trusted files and see if that cures the problem. :mellow:

M23

I'm running the current version and this is when the problem surfaced. I can compile with aut2exe with no problem and it appears that this one program i'm getting the permission error. Other programs compile from SciTe without issue. I checked the folders being open and that was not the case. Something has to be wrong with the code or it's resources. I'll continue my resolution in that area. Thanks for your help.

Link to comment
Share on other sites

  • 2 weeks later...

I'm running the current version and this is when the problem surfaced. I can compile with aut2exe with no problem and it appears that this one program i'm getting the permission error. Other programs compile from SciTe without issue.

I had the same problem and in my opinion this is an AV scanning issue: UPX tries to access the file for compressing while AV scanner is still scanning it. Using a short delay in AutoIt3Wrapper solved my problem (this refers to version 3.3.6.1 !)

Edit the file C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 and locate the following lines:

If FileExists($UPX_Pgm) Then
                ConsoleWrite(">Running:(" & $PgmVer & "):" & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"' & @CRLF)
                $Pid = Run('"' & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"', "", @SW_HIDE, $STDOUT_CHILD)
                If $Pid Then
                    $Handle = _ProcessExitCode($Pid)
                    ProcessWaitClose($Pid)
                    ConsoleWrite(StdoutRead($Pid))
                    StdioClose($Pid)
                    $ExitCode = _ProcessExitCode($Pid, $Handle)

Right after line

If FileExists($UPX_Pgm) Then

insert this code (at line 1096)

; Waiting several seconds before creating UPXed file
                ; - just for the case an AV-scanning process is
                ;   blocking file operation
                ; Default: 2 Seconds for each 500 kBytes, adjust to suite your demand.
                ;====== BEGIN =======
                Global $iPatch_FileSize, $iPatch_Seconds
                $iPatch_FileSize = FileGetSize($ScriptFile_Out)
                $iPatch_Seconds = Round($iPatch_FileSize / 512000)
                ConsoleWrite(">pre-UPX: Filesize of [" & $ScriptFile_Out & "] is " & $iPatch_FileSize & " kBytes" & @CRLF)
                ConsoleWrite(">pre-UPX: Waiting " & $iPatch_Seconds & " seconds ...")
                Sleep($iPatch_Seconds * 2000)
                ConsoleWrite(" done." & @CRLF)
                ;====== END =========

Compile it and replace old AutoIt3Wrapper.exe.

You should use an other filename as AutoIt3Wrapper.exe and rename it after compiling.

Hope this works for you, too.

Good luck!

Edited by Amax
Link to comment
Share on other sites

Thanks, I will give that a try also. I found a simpler fix for the time being. In the compile option, if I just uncheck UPX, it compiles fine without errors. I lose the UPX compression, but if I want that I can still use the UPX.exe to compress the file.

Thanks.

I had the same problem and in my opinion this is an AV scanning issue: UPX tries to access the file for compressing while AV scanner is still scanning it. Using a short delay in AutoIt3Wrapper solved my problem (this refers to version 3.3.6.1 !)

Edit the file C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 and locate the following lines:

If FileExists($UPX_Pgm) Then
                ConsoleWrite(">Running:(" & $PgmVer & "):" & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"' & @CRLF)
                $Pid = Run('"' & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"', "", @SW_HIDE, $STDOUT_CHILD)
                If $Pid Then
                    $Handle = _ProcessExitCode($Pid)
                    ProcessWaitClose($Pid)
                    ConsoleWrite(StdoutRead($Pid))
                    StdioClose($Pid)
                    $ExitCode = _ProcessExitCode($Pid, $Handle)

Right after line

If FileExists($UPX_Pgm) Then

insert this code (at line 1096)

; Waiting several seconds before creating UPXed file
                ; - just for the case an AV-scanning process is
                ;   blocking file operation
                ; Default: 2 Seconds for each 500 kBytes, adjust to suite your demand.
                ;====== BEGIN =======
                Global $iPatch_FileSize, $iPatch_Seconds
                $iPatch_FileSize = FileGetSize($ScriptFile_Out)
                $iPatch_Seconds = Round($iPatch_FileSize / 512000)
                ConsoleWrite(">pre-UPX: Filesize of [" & $ScriptFile_Out & "] is " & $iPatch_FileSize & " kBytes" & @CRLF)
                ConsoleWrite(">pre-UPX: Waiting " & $iPatch_Seconds & " seconds ...")
                Sleep($iPatch_Seconds * 2000)
                ConsoleWrite(" done." & @CRLF)
                ;====== END =========

Compile it and replace old AutoIt3Wrapper.exe.

You should use an other filename as AutoIt3Wrapper.exe and rename it after compiling.

Hope this works for you, too.

Good luck!

Link to comment
Share on other sites

  • 2 months later...

I had the same problem and in my opinion this is an AV scanning issue: UPX tries to access the file for compressing while AV scanner is still scanning it. Using a short delay in AutoIt3Wrapper solved my problem (this refers to version 3.3.6.1 !)

Edit the file C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 and locate the following lines:

If FileExists($UPX_Pgm) Then
                ConsoleWrite(">Running:(" & $PgmVer & "):" & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"' & @CRLF)
                $Pid = Run('"' & $UPX_Pgm & '" ' & $INP_Upx_Parameters & ' "' & $ScriptFile_Out & '"', "", @SW_HIDE, $STDOUT_CHILD)
                If $Pid Then
                    $Handle = _ProcessExitCode($Pid)
                    ProcessWaitClose($Pid)
                    ConsoleWrite(StdoutRead($Pid))
                    StdioClose($Pid)
                    $ExitCode = _ProcessExitCode($Pid, $Handle)

Right after line

If FileExists($UPX_Pgm) Then

insert this code (at line 1096)

; Waiting several seconds before creating UPXed file
                ; - just for the case an AV-scanning process is
                ;   blocking file operation
                ; Default: 2 Seconds for each 500 kBytes, adjust to suite your demand.
                ;====== BEGIN =======
                Global $iPatch_FileSize, $iPatch_Seconds
                $iPatch_FileSize = FileGetSize($ScriptFile_Out)
                $iPatch_Seconds = Round($iPatch_FileSize / 512000)
                ConsoleWrite(">pre-UPX: Filesize of [" & $ScriptFile_Out & "] is " & $iPatch_FileSize & " kBytes" & @CRLF)
                ConsoleWrite(">pre-UPX: Waiting " & $iPatch_Seconds & " seconds ...")
                Sleep($iPatch_Seconds * 2000)
                ConsoleWrite(" done." & @CRLF)
                ;====== END =========

Compile it and replace old AutoIt3Wrapper.exe.

You should use an other filename as AutoIt3Wrapper.exe and rename it after compiling.

Hope this works for you, too.

Good luck!

This worked like a charm!! Thanks I was having the same problem the subject mentioned.
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...