joiner Posted April 28 Posted April 28 Hello everyone. Perhaps my question is more about the OS than autoit. Project: files are packed into archives, then all this is packed into Inno Setup via its script. When launched, Inno Setup unpacks some of the files into a temporary folder and launches "autoit3.exe file.a3x". The last file creates a graphical autoit window. Automatically searches for a path to a specific folder. Next, the window selects files for unpacking. At this time, Inno Setup is waiting for a list of files. Mutex is used. And when you click the "install" button (unpacking additional files from Inno Setup), the Inno Setup process is in "paused" mode. Everything freezes. If you select the path manually, there is no freeze. For some, this does not help. If you run the autoit file from a temporary folder manually, there is no freeze. Decided that the problem was in Inno Setup (latest version) I used another option - only autoit works, extracts files from itself and runs "autoit3.exe file.a3x". Again, it freezes. If I run it manually from a folder, it works without problems. But if I create a .bat command file and run "autoit3.exe file.a3x", it freezes again. Now an important point: this has not been observed for several years of the project's work. And everything works fine on my computers and still works amazingly. This problem occurred to some users. A small number. As one of them said, in more than 90% of cases the code works for everyone. Is the problem in the OS? Different builds with reduced functionality? Why does the system put the parent process in the "suspended" state? Moreover, in this mode the parent process begins to strain the computer's processor up to 20-30%. Running as administrator or regular user does not solve the problem Windows 10-11 operating systems Used udf _GDIPlus_StripProgressbar.au3 Bass.au3
argumentum Posted April 28 Posted April 28 1 hour ago, joiner said: Why does the system put the parent process in the "suspended" state? An anti virus may want to do that while it figures out if "yes or no" on the current process and its files. Look into that. Unless that is not it but I doubt that is anything else. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
argumentum Posted April 28 Posted April 28 ..no idea. 2 hours ago, joiner said: Setup is waiting for a list of files. Mutex is used. And when you click the "install" button (unpacking additional files from Inno Setup), the Inno Setup process is in "paused" mode. Everything freezes. If you select the path manually, there is no freeze. For some, this does not help. Maybe there is a path that is slow to return ( mapped network, drive in sleep mode ) and that does it ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
joiner Posted April 29 Author Posted April 29 (edited) the program is launched from the system disk. The required folder is located on the system disk ssd disk the path search occurs in the system registry Edited April 29 by joiner
argumentum Posted April 29 Posted April 29 ..am at a loss. Without a sample code to compile on my side to run and investigate, ..am out of ideas. And even if you shared the code, I'd have a small percentage of been able to find it with the described flaws given that is sporadic. Is up to you. As is, I don't find a way to help more. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
joiner Posted April 29 Author Posted April 29 (edited) Thanks for your participation. Yes, you probably won't get such a bug. The user of my project said that the project works fine for the vast majority of people. In my system, the main process is in standby mode and quickly responds to the command of the child script. I did the project on different computers and systems. I have never encountered such a bug That's why I decided that it was the operating system's fault. Okay, thanks again for the answers. Maybe someone will suggest another reason I'll leave a link to the source codes. Compilation in a3x files for compilation: controlw_def fileprjt_def JMPACK _def unmod_def The fileprjt_def file is an installation file. It works when installing files in the desired folder. Launch after compilation - click on the RunJMPack.bat file The official version of Inno Setup is in the CompilerISS folder. This program is a shell for the project, the parent process. The download example is in the Project folder. This can be compiled into an executable file. The language folder contains translations of the program interface. When you launch the program, select your language. I want to assure you that my program does not corrupt other people's files, does not serve to hack programs, and is not a bot or clicker. Thank you download Edited April 29 by joiner
argumentum Posted April 29 Posted April 29 wow, ..I meant the basic offending process, not the whole project. I'll look at it tomorrow. Got to AFK. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
joiner Posted May 7 Author Posted May 7 rewrote part of the project. excluded inno setup. made a record of files in the program body. the problem remained. even tried compiling in x64. an error appeared about the impossibility of executing the script. found the error line. the problem is in Scripting.Dictionary Perhaps the primary error, the slow reaction of the program up to freezing, is also related to Scripting.Dictionary. now I want to use Map functions instead of Scripting.Dictionary I plan to rewrite only the installer code - fileprjt_def argumentum 1
joiner Posted May 27 Author Posted May 27 (edited) Good day. Sorry for not responding. I was busy with my main job. I excluded the use of inno setup from the project. I also excluded Scripting.Dictionary. The constructor itself uses Scripting.Dictionary, and in the installation file I use Map I wrote a simple library to make it convenient. I left the archiver. Now the archives and installer files are written to the program body. Then they are extracted as needed or at the user's discretion. Let me remind you that the described problem was found in a small number of users. After changing the code, the problem went away. On Windows 10 for sure. With Windows 11, there was a problem with the program for those whose computer was not designed for this operating system. Stripped-down builds of the operating system were installed. It always works fine on my PC. In both operating systems. I hope the developers will leave Map among other functions I can put: the problem is solved Thank you Edited May 27 by joiner argumentum 1
joiner Posted Wednesday at 12:10 PM Author Posted Wednesday at 12:10 PM (edited) I have to admit that the solution was partial I found the problem. Below is a part of the code describing the problem expandcollapse popup;~ when using this function, an error occurs "Variable is used without being declared" ;~ The variable can be random from the code. All variables are declared $iTimerProgress = _Timer_SetTimer($WOTP, 30, 'PlayAnim') ;~ Or ;~ If you use these lines, the program freezes for some users. GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $WOTP, "int", 0, "int", 30, "int", 0) ;~ If you don't use the progress install code, the program works fine for everyone. Func PlayAnim() $hHBmp_BG = _GDIPlus_StripProgressbar($iPercData, $WPerc, $HPerc, $iVisPerc, $BgColorGui, $FgBGColor, $BGColor, $TextBGColor, $sFontProgress) Local $hB = GUICtrlSendMsg($iPercId, 0x0172, 0, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) EndFunc ;==>PlayAnim Func _GDIPlus_StripProgressbar($fPerc, $iW, $iH, $iVisP = 1, $iBgColorGui = 0x000000, $iFgColor = 0x808080, $iBGColor = 0x0000FF, $iTextColor = 0xFFFFFF, $sFont = 'Arial Black') Local $sPerc = Ceiling($fPerc) If $sPerc < 0 Then $sPerc = 0 If $sPerc > 100 Then $sPerc = 100 _GDIPlus_Startup() Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) _GDIPlus_GraphicsClear($hCtxt, 0xFF000000 + $iBgColorGui) Local $iWidth = $iH * 2, $iLen = $iWidth / 2, $iY Local $hBmp = _GDIPlus_BitmapCreateFromScan0($iWidth, $iH) Local Const $hCtxt_Bmp = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt_Bmp, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local $hPen = _GDIPlus_PenCreate(0xFF0000000 + $iFgColor), $iPenSize = Int($iH / 12) Local $hPen2 = _GDIPlus_PenCreate(0x50000000, $iPenSize) _GDIPlus_GraphicsClear($hCtxt_Bmp, 0xFF000000 + $iBGColor) Local Static $iX = 0 For $iY = 0 To $iH - 1 _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, -$iX + $iY, $iY, -$iX + $iY + $iLen, $iY, $hPen) _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, -$iX + $iY + 2 * $iLen, $iY, -$iX + $iY + 3 * $iLen, $iY, $hPen) Next Local $tPoint1 = DllStructCreate('float;float') Local $tPoint2 = DllStructCreate('float;float') DllStructSetData($tPoint1, 1, $iW / 2) ;x1 DllStructSetData($tPoint2, 1, $iW / 2) ;x2 _GDIPlus_GraphicsDrawLine($hCtxt_Bmp, 0, 0, $iWidth, 0, $hPen2) $iX = Mod($iX + 2, $iWidth) Local $hTextureBrush = _GDIPlus_TextureCreate($hBmp) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $sPerc / 100 * $iW, $iH, $hTextureBrush) If $iVisP Then _GDIPlus_GraphicsSetTextRenderingHint($hCtxt, 5) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iTextColor) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local $hFont = _GDIPlus_FontCreate($hFamily, $iH * 2.5 / 5, 2) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_GraphicsDrawStringEx($hCtxt, $sPerc & '%', $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) EndIf _GDIPlus_PenDispose($hPen) _GDIPlus_PenDispose($hPen2) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_GraphicsDispose($hCtxt_Bmp) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_BrushDispose($hTextureBrush) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() Return $hHBITMAP EndFunc ;==>_GDIPlus_StripProgressbar The attached file contains the entire program code What did I do wrong? the code cannot be run in the editor. and after compilation it will give an error it only works when compiled in the program designer. fileprjt.au3 Edited Wednesday at 12:23 PM by joiner
argumentum Posted Wednesday at 12:52 PM Posted Wednesday at 12:52 PM 34 minutes ago, joiner said: the code cannot be run in the editor. and after compilation it will give an error it only works when compiled in the program designer. Wow, looks complicated. ... ;~ $aDataZipPos - array is written during compilation Func _EXMOD() If UBound($exmods) = 0 Then Return If _mExistsKey($oMod, 'info' & $CurGui) Then GUICtrlSetData(_mGetValueKey($oMod, 'info' & $CurGui), $Instjmplang[13]) _ExtractFiles($exmods, $wkdir, $aDataZipPos, @ScriptFullPath) ... "R:\JMP\fileprjt.au3"(3431,45) : warning: $aDataZipPos: possibly used before declaration. _ExtractFiles($exmods, $wkdir, $aDataZipPos, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Try forking the troublesome part of the code, so is not in the same thread. And easier to debug too. By the way, you've been here since 2013 so, you know the forum rules by now. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
joiner Posted Thursday at 02:14 PM Author Posted Thursday at 02:14 PM the problem is in the code above. that is, creating a progress bar. when disabling the above functions, everything works. having disabled all the other problems by changing the code, I came to the last problem. which I wrote about above. it was this part of the code that caused the freeze with a chaotic error that this or that variable was not declared. The $aDataZipPos array is written during compilation. It is a list of files
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