Source of validation script in "Finish" screen - installation

Is it possible to distinguish the source inside the script that is written as content of the "Validation expression"?
This script gets triggered when any of the buttons is pressed: "Close", or "x" button in the screen frame.
I would like to have some additional handling if the "x" is the source (prevent launching of the app even if the default checkbox is triggered, do some custom stuff, etc.).

For most screens, the validation script is only executed if the "Next" button is clicked. The one exception is the "Finish" screen or any screen that has the "Quit after screen" property selected. On those screens, closing the window is equivalent to clicking on the "Finish" button. Unfortunately, there is no way to distinguish between the two.
Some users choose to close installers on the last screen by closing the window and that could lead to a rollback if the distinction between "finish" screens and regular screens were not made.

Related

In AppleScript, how to make code run if a button is pressed and other code run if a different button is pressed?

In Apple Script, I'm making a fake Virus as a prank and I want to know how to make it so if one button is pressed, some code is run and if a different button is pressed, other code runs.
Here's what I have so far:
display alert "Warning: Non-Standard hardware detected in
core files. Please close all applications to allow
maximum processing power."
delay 5
display alert "Warning: Non-standard hardware detected in
core files. Core files may become corrupted."
delay 5
display alert "Non-standard hardware reaching dangerous
level. If you would like to continue with purge process
and risk your core files, click OK. If you would like to
abort the process and leave the hardware, exit now."
buttons {"Ok", "Cancel"} default button 1
I want it so if the user clicks the "Ok" button one thing happens and if they click "Cancel" another happens. I'm not experienced in Apple Script, this is my first script made in it.
Edit: I would also like to know how to make it auto-run when you double click it, because right now when I double click it Apple Script Editor opens and I just want it to instantly run.
I reformatted your code to make it easier to work with. After editing it to your needs, just save it as an application in script editor. Then double-clicking that new app will launch your script… Not script editor.
property displayAlert1 : "Warning: Non-Standard hardware detected in
core files. Please close all applications to allow
maximum processing power."
property displayAlert2 : "Warning: Non-standard hardware detected in
core files. Core files may become corrupted."
property displayAlert3 : "Non-standard hardware reaching dangerous
level. If you would like to continue with purge process
and risk your core files, click OK. If you would like to
abort the process and leave the hardware, exit now."
display alert displayAlert1
delay 5
display alert displayAlert2
delay 5
set buttonReturned to button returned of ¬
(display alert displayAlert3 buttons {"Ok", "Cancel"} default button 1)
if buttonReturned is "Ok" then
display dialog "Your Computer Will Explode In 1 Minute" buttons {"Cancel", "OK"} ¬
default button "OK"
else if buttonReturned is "Cancel" then
display dialog "Your Computer Will Explode In 2 Minutes" buttons {"Cancel", "OK"} ¬
default button "OK"
end if

vb6 button click event strange behaviour

I have a very large accounting system. In a user preferences section, the program has begun to act abnormally on my development machine only. No customers are reporting this, nor can I duplicate it on any of my other computers. Running Windows 8.1, others are on 7.0. Not exactly sure when this started happening because it's not the kind of thing one goes into on a regular basis. The preferences screen consists of a tab control and various standard controls. At the bottom is Okay, Cancel, and Apply buttons. All three buttons seem to be acting with the same strange behaviour. Clicking with a mouse does not generate a click event yet does not hang the system - mouseup follows and you can click it again and see the mousedown and mouseup but no click. However, since the Okay is defined as Default, pressing enter DOES create the desired click event, and all the code inside that even runs fine. Cancel and Okay also unload the form, but when clicked, that doesn't happen because none of the code gets executed, yet you can still navigate the screen (move between tabs and controls) but you can't even click the "X" button to close the form at that point.
Also, if you go straight in, and press enter, everything works and the form unloads, but if you do anything before pressing enter (or escape to cancel), like change a tab and/or edit a value, then press enter, the click event again does not run and the system semi-hangs.
I tried turning-off my anti-virus thinking that might have something to do with it, but no-go. Debugging is frustrating because while I finally got it execute the click event, the stop command inside that event (after debug.print "click") would allow stepping and success if just straight in and enter, but if anything else done as before described would stop at the stop statement (keyboard enter only still no mouse clicks under any scenario) and would do a total lock-out. In other lockouts where it would let me navigate, almost always selecting a new tab would cause a fatal error and it would force-unload VB for me, otherwise I had to use the task manager.
This is driving me nuts, but I don't know how else to debug it.
The culprit was tv_w32.dll which is Team Viewer. Turning-off Team Viewer allows my program to run normally.

Browser IE :clicking on alert ok causes the dijit dialog in background to hide away visually

I have a dijit dialog that pops up on clicking of a button. This dialog has a button which stands for submitting and one to hide the dialog On click of ok it sends a REST call and gets a response.
On error, an alert box is generated.
But what is happening here in IE 8 is that I need to explicitly again call a showdialog method to retain the dialog on screen.
What is expected behaviour is: when error occurs an alert box pops up and on click of ok the dialog in background retains. But this is not occuring normally. So I need to everytime check response and make an explicit call to show that dialog. If I do not call an explicit showdialog, the dialog simply visually seems nowhere(Gone!).
This is not a requirement if I use other browsers like chrome and FF which retain the dialog unless user himself cancels and hides them.
This explicit calling may not have been a problem unless it caused the blink effect. That is it has some delay and then shows( a sec or two after ok click on alert).
Further adding to the woe is that when this error scenario occurs and if user after clicking ok and then getting the dialog again after a blink follows and clicks cancel on dialog....poof! the behind screen that originally triggered that dialog still remains blurred! Hanging the browser!
Thanks & yes need a help, stuck on this!

Upload dialog in Chrome and Firefox on Mac doesn't disable mouseout event for the page element

My task is to implement a file upload form in a popup sub-menu panel. I am using XmlHttpRequest, so it's important to keep that popup opened until I receive an event status that file loading completed/failed. Onmouseover and onmouseout events are used to show/hide the popup.
On "hide" the popup panel is detached from the DOM, and cannot be used anymore as a listener for XHR events.
When I click form's "Browse" button, a system dialog window is opened above the browser. In IE, Chrome and Firefox in Windows the system dialog disables events handling by page. Which means if you move a mouse cursor out of the dialog window on one of the page element, the page won't do anything like reacting on mouseOver/mouseOut events. Unfortunately, in case with Chrome/Firefox on Mac (Safari is OK) the page elements do react on mouse over/out. And my popup menu becomes closed (due to mouseOut event handler for the popup) -> XHR response is not managed properly.
Assuming having an upload form in a popup is a must, what are the possible ways of keeping that panel/form visible while system Upload File dialog window is up? Probably a Mac specific solution.
Sample code can be seen here http://jsfiddle.net/xqvXG/
Solved this by freezing popup panel and covering the whole page with transparent div ('glass').
In case if user chooses file(s) and upload starts, I remove the glass and unfreeze the popup using the XHR function readyStateChangeHandler (or may do that in handler of load event).
If user clicks Cancel in system dialog window or closes it with "X" button - no events passed to the page and 'glass' remains on screen. Then any click on the 'glass' causes its removal and unfreezing (or simple hiding) the popup menu.
'Glass' is required to make a single one-click point (panel) for unfreezing the popup in case if Cancel/Close were pressed.
I wouldn't say this is a perfect solution (sometimes required extra action), but very close to what I was looking for.

Rgui - disable right click on plot window?

I've written a routine whereby a user is displayed an image (using grid.raster) and they click on it to define a region of interest (grid.locator).
I added in support for the user to right-click on the plot instead of left-click, which would undo their previously-clicked point.
This works by testing whether grid.locator() returns NULL (from the help file: "If the user did not click mouse button 1, the function (invisibly) returns NULL).
This works fine on Linux, but in Windows using Rgui, right-clicking the plot window brings up a context menu with 'Stop' and 'Continue' and continues waiting for you to click (i.e. the right click is not detected by grid.locator() since it's intercepted for the context menu first).
Is there some way to disable the right click context menu for the plot window in Rgui?
(The user is only going to use Rgui. For the moment I can tell them to use the middle click button to undo instead of right click and this works, but it is moot if they don't have a button with a scroll wheel/middle click button. Alternatively if there's some way I can listen for a keyboard event without having to load a UI package like gtk or tcltk I'm happy for that to happen too).

Resources