I've got an odd one here. I've updated some old code that ran file previously. The update primarily just added the window title identification string to the INI file instead of being hardcoded in the script. I'm compiling the code on Windows 8.1 x64 and running it on Windows 8.1 x32 (previously ran fine on WinXP x32). There are restrictions on this PC. Through group policy, the C drive is hidden/inaccessible. This program is being run via the registry upon boot and is found in C:\sspl_stuff\kiosk\. The INI file is located in the same directory as the executable.
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <BlockInputEx.au3> ; Attempts to block ALT+TAB from working (works in XP, sort of mimics it in >= Vista #include <GDIPlus.au3> ; Fixes issue with odd transparent pixels w/normal AutoIt image/background methods ; --- FORCED DISPLAY SIGNAGE CODE --- ; $minutes_until_display = IniRead("settings.ini", "TimerScreenSettings", "minutes_until_display", 10); $window_class = IniRead("settings.ini", "TimerScreenSettings", "window_class", "[REGEXPTITLE:(.* minutes)]"); ;$left = (1024 - $image_width) / 2; Image centering placement ;$top = (768 - $image_height) / 2; Image centering placement ; Create newlines from the settings.ini file information ; --- TIME/WINDOW DETECTION CODE --- ; $window = WinWait($window_class, "", 1); Pauses script execution until the Cassie timer/application toolbar window is created and active While 1 ; --- Set the Form Controls --- ; ; Window ; Background image $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\" & $splash_image); load bitmap as GDI+ bitmap ; Close button ; Dummy button for use with blocking key commands ; Label text ;--- Block certain keys/combos for XP machines ---; ; Enter, Space, SHIFT+TAB, WIN+TAB, ALT+SHIFT+TAB, WIN+SHIFT+TAB Local $AccelKeys[3][2] = [["{ENTER}", $dummyCtrl1], ["{SPACE}", $dummyCtrl1], ["!{TAB}|#{TAB}|!+{TAB}|#+{TAB}", $dummyCtrl2]]; ; --- Display the Coded Form --- ; ; Watch for key accelerators and perform an action while window open, or close window after set time expires ; DO NOTHING ; DO NOTHING Remove(); ; --- CLOSE THE KIOSK GUI EARLY --- ; Exit;
Lines 49-57 can be commented out to see the program run and what it's doing (it waits for a window title to update to an appropriate value, then runs - it's for a public library computer reservation system).
Settings file:
[SplashScreenSettings] time_delay_secs=5 background_color=000000 splash_image=splash.jpg [TimerScreenSettings] minutes_until_display=10 time_delay_secs=37 background_color="000000" splash_image="alert_1024x768.jpg" text_color="AAD4FF" font_size=20 font_weight=600 close_msg="I Understand" font_family="Cambria Bold" message_text="\nYou have under 10 minutes remaining.\nContents saved *ON THE COMPUTER* will be *ERASED* at the end of your session.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n To prevent loss of work, please save externally now.\n Please see the clerk for any assistance." button_width=300 button_height=60 button_left=493 ;1024 -> 1280 = 256 / 2 = 128 + 365 = 493 | old 365 button_top=836 ;768 -> 1024 = 256 / 2 = 128 + 708 = 836 | old 768 image_width=1024 image_height=768 window_class="[REGEXPTITLE:(.* minutes)]" ;window_width=1024 ;window_height=768
Unfortunately my customized settings are not being read, only the alternate default settings (hardcoded in the application) are being used. The application and settings.ini file are both in the same folder. A different application is using the settings file as expected (compiled from an older build of AutoIt, I'm currently running v3.3.10.2 - which doesn't seem to use the AutoIt icon for compiled executables?)
Any ideas on why the INI might not be getting read on the target PC? It runs as expected when in the editor on my local dev PC.
EDIT: Just in case you're being curious and are examining every single line, note that the variable $window_class is a misnomer. I simply didn't update the variable name when I switched from class to REGEXTITLE (the class kept dynamically changing on each run).