NitLions
03-19-2007, 02:01 PM
I have several things that I search for (Registry entries, files, etc.) as a prerequisite for enabling a button to install our software, let's say. If something is missing, I go to a requirements page, which shows what is missing. I also have the searches in an OnTimer script, which will refresh the requirements page once a requirement has been installed (registry entry, file, etc. now found so the requirements page indicates this is now OK).
All works fine, but I saw a small glitch, if you want to call it that, when running this on a 64-bit system. I don't know if being 64-bit has anything to do with it, but as the requirements page of my browser is displayed, and the OnTimer events are running/searching, I see a small command window, minimized on the taskbar, flashing.
What happens then is that, when trying to install a requirement, the focus seems to switch quickly between my requirement install and the minimized flashing command window. So, as a result, you have to quickly click several times to get desired button click responses on the process that should really have focus (installation of a requirement).
Has anyone else seen this? I haven't seen or noticed this behavior on any other systems and haven't heard about it from QA at all.
Any info is appreciated!
:o
What are you executing within the On Timer event that opens that command window?
Little of topic here.
But the OnTimer event of AMS6 is actually, in my opinion, a waste of an event because it doesn't even act like a normal timer event as seen in other languages.
I understand that Lua is not a multi thread-able language, just coroutines which aren't threaded anyway. Anyway, the OnTimer event is only good if you need to start a piece of code in a delay. A good thing would be to have the OnTimer event a separate thread so that the code can run along side every thing else and not be slowed due to having to wait for the next coroutine.yield.
Back on topic:
If you call anything with the File.Run or Shell.Execute function in AMS6 it will temporarily open a command window as the command is executed.
I haven't personally seen the type of behavior you are talking about with any other function call. As Worm says, what are you executing in the OnTimer Event?
NitLions
04-18-2007, 03:24 PM
Here's my OnTimer script for my prerequisites page:
--added to check if install button can be enabled to proceed
allok = 1
if Registry.DoesKeyExist(HKEY_CURRENT_USER, "Software\\Synergis\\Adept7.0\\DOMAINS") then
--Label.SetVisible("AdeptOK", true);
Image.SetVisible("AdeptCheck", true);
--Label.SetVisible("AdeptNeeded", false);
Image.SetVisible("AdeptX", false);
else
allok = 0
end
result = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\InetStp", "MajorVersion", true);
if result == "5" or result == "6" or result == "7" then
--Label.SetVisible("IISOK", true);
Image.SetVisible("IISCheck", true);
--Label.SetVisible("IISNeeded", false);
Image.SetVisible("IISX", false);
Button.SetEnabled("IISButton", false);
else
allok = 0
end
if Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\.NETFramework\\policy\\v2.0") then
--Label.SetVisible("NETOK", true);
Image.SetVisible("NETCheck", true);
--Label.SetVisible("NETNeeded", false);
Image.SetVisible("NETX", false);
Button.SetEnabled("NETButton", false);
else
allok = 0
end
--Changed Java Runtime test as it seems uninstall was not removing test key. If previously installed
--then removed, requirement may not be evaluated properly
--if Registry.DoesKeyExist(HKEY_CURRENT_USER, "Software\\JavaSoft\\Java Runtime Environment") then
----Label.SetVisible("JavaOK", true);
--Image.SetVisible("JavaCheck", true);
--Label.SetEnabled("JavaDownload", false);
--Label.SetText("JavaDownload", "No Download Needed!");
----Label.SetVisible("JavaNeeded", false);
--Image.SetVisible("JavaX", false);
--else
--allok = 0
--end
File.Run("java", "-fullversion", "", SW_MINIMIZE, false);
err = Application.GetLastError();
if err > 0 then
-- no java
allok = 0
else
Image.SetVisible("JavaCheck", true);
Label.SetEnabled("JavaDownload", false);
Label.SetText("JavaDownload", "No Download Needed!");
Image.SetVisible("JavaX", false);
end
if allok == 1 then
Label.SetVisible("BackLabel", false);
Button.SetEnabled("BackButton", false);
Button.SetVisible("BackButton", false);
Label.SetVisible("InstallLabel", true);
Button.SetEnabled("InstallButton", true);
Button.SetVisible("InstallButton", true);
end
This will run and here is what can be executed if any requirements are lacking....
If the Java Runtime is lacking, there is a quick link to http://www.java.com/en/download/index.jsp where they can download and install the runtime. I don't know that the behavior is exhibited here.
If IIS is lacking, there is a button scripted with
File.Run("control", "appwiz.cpl,,2", "")
If .NET Framework is lacking, there is a button scripted with result = File.Run("AutoPlay\\dotnetfx.exe", "", "", SW_SHOWNORMAL, true);
I guess I may have to update my Prerequisites page in real time in some other way. Maybe I'll have to do away with the OnTimer scripted stuff and possibly update the page (change an image from a red X to a green OK when the install of the item is finished and the search completes successfully) when the individual install items finish successfully.
Any suggestions welcomed!!
NitLions
05-03-2007, 08:51 AM
This helped...
I increased the timer form (100) to (10000). This way the OnTimer checks only run every 10 seconds, which works fine for our useage. This virtually eliminates the problem. That was simple!!
:D
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.