Jump to content

Recommended Posts

Posted (edited)

Installation appeared to hang for 2-3 minutes with the message "Target was appended to PSModulePath"

I was about to kill it when it restarted.

(Installing 64bit version of v3.3.14.0 on Windows10 beta)

Clipboard01.jpg

Edited by dgm5555
extra info
Posted

Anti-virus maybe?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

dgm5555,

My Autoit installations also hang at that point - although not for that long - so it is not just you.

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:

  Reveal hidden contents

 

Posted

The SciTE4 installation also hangs for a minute at "Tell Windows to Update Environment". Given the rest of the installation (and almost every other installation I've tried) takes 15-20 seconds on my system, this seems to me a significant glitch.

 

  • Moderators
Posted

dgm5555,

 I have asked Jon to pop in - it is his installer.

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:

  Reveal hidden contents

 

  • Administrators
Posted

Hmm, that just updating the PSModulePath environment variable. That's been in the installer (beta) for about a year and I've not seen any other reports. It takes about 1-5 seconds on my install usually.

@Jos are you changing any env variables - what is happening in the scite installer at "Tell Windows to Update Environment"?  In the main installer I'm using a nsis addon like this:

${EnvVarUpdate} $0 "PSModulePath" "A" "HKLM" "$INSTDIR\AutoItX" ; Append

 


 

  • Administrators
Posted (edited)

@dgm5555 could you run these three scripts and post the results please? 

Script1

Global Const $HWND_BROADCAST = 0xFFFF
Global Const $WM_SETTINGCHANGE = 0x001A

Global Const $SMTO_BLOCK = 0x0001
Global Const $SMTO_NORMAL = 0x0000
Global Const $SMTO_ABORTIFHUNG = 0x0002

$time = TimerInit()
MsgBox(4096, "", "Script1")
_WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 5000, $SMTO_NORMAL)
MsgBox(4096, "", "Script time: " & Round(TimerDiff($time) / 1000, 2))

Func _WinAPI_SendMessageTimeout($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iTimeout = 1000, $iFlags = 0)
    Local $aRet = DllCall('user32.dll', 'lresult', 'SendMessageTimeoutW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, _
            'lparam', $lParam, 'uint', $iFlags, 'uint', $iTimeout, 'dword_ptr*', 0)
    If @error Then Return SetError(@error, @extended, -1)
    If Not $aRet[0] Then Return SetError(10, _WinAPI_GetLastError(), -1)

    Return $aRet[7]
EndFunc   ;==>_WinAPI_SendMessageTimeout

 

Script2

Global Const $HWND_BROADCAST = 0xFFFF
Global Const $WM_SETTINGCHANGE = 0x001A

Global Const $SMTO_BLOCK = 0x0001
Global Const $SMTO_NORMAL = 0x0000
Global Const $SMTO_ABORTIFHUNG = 0x0002

$time = TimerInit()
MsgBox(4096, "", "Script2")
_WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 5000, $SMTO_BLOCK+$SMTO_ABORTIFHUNG)
MsgBox(4096, "", "Script time: " & Round(TimerDiff($time) / 1000, 2))

Func _WinAPI_SendMessageTimeout($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iTimeout = 1000, $iFlags = 0)
    Local $aRet = DllCall('user32.dll', 'lresult', 'SendMessageTimeoutW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, _
            'lparam', $lParam, 'uint', $iFlags, 'uint', $iTimeout, 'dword_ptr*', 0)
    If @error Then Return SetError(@error, @extended, -1)
    If Not $aRet[0] Then Return SetError(10, _WinAPI_GetLastError(), -1)

    Return $aRet[7]
EndFunc   ;==>_WinAPI_SendMessageTimeout

 

Script3

Global Const $HWND_BROADCAST = 0xFFFF
Global Const $WM_SETTINGCHANGE = 0x001A

Global Const $SMTO_BLOCK = 0x0001
Global Const $SMTO_NORMAL = 0x0000
Global Const $SMTO_ABORTIFHUNG = 0x0002

$time = TimerInit()
MsgBox(4096, "", "Script3")
_WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 250, $SMTO_NORMAL)
MsgBox(4096, "", "Script time: " & Round(TimerDiff($time) / 1000, 2))

Func _WinAPI_SendMessageTimeout($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iTimeout = 1000, $iFlags = 0)
    Local $aRet = DllCall('user32.dll', 'lresult', 'SendMessageTimeoutW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, _
            'lparam', $lParam, 'uint', $iFlags, 'uint', $iTimeout, 'dword_ptr*', 0)
    If @error Then Return SetError(@error, @extended, -1)
    If Not $aRet[0] Then Return SetError(10, _WinAPI_GetLastError(), -1)

    Return $aRet[7]
EndFunc   ;==>_WinAPI_SendMessageTimeout

 

Edited by Jon


 

  • Developers
Posted (edited)
  On 7/16/2015 at 9:48 AM, Jon said:
@Jos

 are you changing any env variables - what is happening in the scite installer at "Tell Windows to Update Environment"?  In the main installer I'm using a nsis addon like this:

Yes, I am creating/updating SCITE_USERHOME in the SciTE4AutoIt3 installer and do something like:

!include "winmessages.nsh"
  !define env_hkcu 'HKCU "Environment" "SCITE_USERHOME"'   
  -- set the $SCITE_USERHOMEDIR to the correct path
  DetailPrint 'Add SCITE_USERHOME to registry'
  WriteRegExpandStr ${env_hkcu} $SCITE_USERHOMEDIR
  ; make sure windows knows about the change
  DetailPrint 'Tell Windows to Update Enviroment'
  SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000

Believe I first tried the available NSIS option but was having issues with that... not sure what any more, but found this one somewhere.

Is that going to be an issue in Win10?

Jos

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.
  :)

Posted (edited)

Win10 has a built-in VS (Windows Defender - Antimalware Service Executable) which is causing probably this delay.

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

  • Administrators
Posted (edited)

Nah, it's todo with hung windows I think. Each window has 5 seconds to respond to the env change message. So if 10 windows don't respond then the delay is 50 seconds.

I'm assuming that when the OP runs those scripts that one of them will be quicker.  In the installer I'm changing the SendMessage line to this:

!include "WinMessages.NSH"
...
...
System::Call "user32::SendMessageTimeoutW(i ${HWND_BROADCAST}, i ${WM_WININICHANGE}, i 0, w 'Environment', i 3, i 1000, i 0)"

Which will be quicker anyway (1 second timeout rather than 5), but also uses SMTO_BLOCK and SMTO_ABORTIFHUNG parameters. 

I should change the EnvUpdate() AutoIt function as well to include the SMTO_ABORTIFHUNG flag.

Edited by Jon
Added NSIS Include


 

  • Administrators
Posted

In your case, probably nothing. For paths I'm not so sure. In the AutoIt source it's set to 15 seconds...It's instant on most machines anway and with the SMTO_ABORTIFHUNG parameter it won't wait at all.


 

Posted

Sorry about the delay.

@Jon you script seems to be timing how long before I press OK for the msgbox. Was that your intention?

I modified the script a bit (including the missing reference too) to the following which repeats the loop changing variables and averages the time:

Let me know though if I busted it from your intended purpose?

#include <WinAPI.au3>
Global Const $HWND_BROADCAST = 0xFFFF
Global Const $WM_SETTINGCHANGE = 0x001A

Global Const $SMTO_BLOCK = 0x0001
Global Const $SMTO_NORMAL = 0x0000
Global Const $SMTO_ABORTIFHUNG = 0x0002

$time1=0
$time2=0
$time3=0

for $i = 1 to 100
    $time = TimerInit()
    _WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 5000, $SMTO_NORMAL)
    $time1 = $time1 + TimerDiff($time)

    $time = TimerInit()
    _WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 5000, $SMTO_BLOCK+$SMTO_ABORTIFHUNG)
    $time2 = $time2 + TimerDiff($time)


    $time = TimerInit()
    _WinAPI_SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, 0, "Environment", 250, $SMTO_NORMAL)
    $time3 = $time3 + TimerDiff($time)

Next

ConsoleWrite(@CRLF & "Script1" & @CRLF)
ConsoleWrite("Script time: " & Round($time1 / 1000/100, 2) & @CRLF)
ConsoleWrite(@CRLF & "Script2" & @CRLF)
ConsoleWrite("Script time: " & Round($time2 / 1000/100, 2) & @CRLF)
ConsoleWrite(@CRLF & "Script3" & @CRLF)
ConsoleWrite("Script time: " & Round($time3 / 1000/100, 2) & @CRLF)


Func _WinAPI_SendMessageTimeout($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iTimeout = 1000, $iFlags = 0)
    Local $aRet = DllCall('user32.dll', 'lresult', 'SendMessageTimeoutW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, _
            'lparam', $lParam, 'uint', $iFlags, 'uint', $iTimeout, 'dword_ptr*', 0)
    If @error Then Return SetError(@error, @extended, -1)
    If Not $aRet[0] Then Return SetError(10, _WinAPI_GetLastError(), -1)

    Return $aRet[7]
EndFunc   ;==>_WinAPI_SendMessageTimeout

The entire SciTe console output was:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\dgm55\OneDrive\Documents\Scripts\test1.au3" /UserParams    
+>08:49:57 Starting AutoIt3Wrapper v.15.503.1200.1 SciTE v.3.5.4.0   Keyboard:00000809  OS:WIN_81/  CPU:X64 OS:X64    Environment(Language:0809)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\dgm55\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\dgm55\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\dgm55\OneDrive\Documents\Scripts\test1.au3
+>08:49:57 AU3Check ended.rc:0
>Running:(3.3.14.0):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\dgm55\OneDrive\Documents\Scripts\test1.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

Script1
Script time: 0.13

Script2
Script time: 0.13

Script3
Script time: 0.12
+>08:50:35 AutoIt3.exe ended.rc:0
+>08:50:35 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 38.5

 

  • Administrators
Posted

None of those hung. It may be a quirk of the SendMessage used in the install then. But I've replaced that for the next beta anyway so keep and eye out for that and see if it fixes.


 

Posted

I am using Windows 10 too  but no delay.°-° Maybe it would help those who have a hung there to use Compatibility Mode Win XP or Win 7. :3

-MAYBE-

  Reveal hidden contents
  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

  • 2 weeks later...
  • Administrators
Posted

@dgm5555 If you could try the latest installer (3.3.14.1) it uses a different method for updating the env - see if that helps.


 

Posted (edited)

@Jon can you update it here: 

 

As I sse last update was at 12 July.

 

 

EDIT: but maybe this is actual version only updated date is incorrect ?

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
  • Recently Browsing   0 members

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