NSIS: How to distinguish between Cancel and Close button - nsis

In NSIS, on a custom page, I want to skip the page when the user presses the Cancel button, but I want to exit the installer (with confirmation) when the user presses the window's X button. How do I do that?
Currently, by using Modern UI and custom abort function, I get the same function called regardless of which of the two buttons is pressed.

This is not normal installer behavior and I would not recommend that you try to implement this.
If you still want to try I guess it might be possible with the ButtonEvent plug-in or the WndSubclass plug-in...

Related

Lotus Notes: Press OK button from script in DialogBox

Is there a method to press "OK" button of a dialogbox by using script ?
i want to obtain the same result like user press ok button but using script
No its not possible. if you want to "automate" this, you have to get rid of the Dialogbox.
BUT: You of course could "mimic" the behaviour by just using NotesUIDocument.Close, or use some JavaScript code as umeli mentioned in his comment...

how to show EULA during upgrade using installshield

the EULA window is enabled through the Interview panel in Installshield 2011, and it works fine when installing the program first time. However, it won't show in the dialog sequence when we do the upgrade.
I guess it is a default behaviour in Installshield, is it possible to show it all the time? is it wise to do so?
You can Launch Eula window (License Agreement dialog) or custom dialog anytime you want.
When upgrade, launch Eula Dialog from NextButton on SetupResume Dialog, move another conditions to Next Button Eula Dialog, if using License Agreement dialog you must add another conditions "Not Installed" to old Eula Dialog conditions
Next Button Events For License Agreement Dialog will be like this:
Event: NewDialog,
Argument: LicenseAgreement,
Condition: Not Installed
Event: EndDialog,
Argument: Return,
Condition: OutOfNoRbDiskSpace <> 1 AND Installed
Next Button Events For SetupResume Dialog:
Event: NewDialog,
Argument: LicenseAgreement,
Condition: 1
I ran into this problem rather recently with InstallShield 2014, and was having a hard time getting the EULA to pop up on the automagic upgrade path even when adding it to the Next button of the SetupInitialization dialog.
I did find a way to make it happen though:
Go into the Behavior and Logic group, select Custom Actions and Sequences. Expand Sequences > Installation > User Interface.
You can right-click and Insert objects into here. From the Insert Action dialog, select Dialogs in the first dropdown. Then select the EULA-displaying dialog (LicenseAgreement in my case). That will insert it into the UI portion of the Installation Sequence.
From there, you can drag it to where you need it. I dropped it in right after SetupInitialization, but you can also drag it down to just after the PatchWelcome / InstallWelcome / SetupResume / MaintenanceWelcome UI components.
If you do this, you'll want to go to your InstallWelcome dialog (normal installation) and make sure that you skip the EULA there in order to avoid showing it twice. Setting the target to ReadyToInstall (the next step of the LicenseAgreement in my case) allowed me to do that.
That said, doing this means that the EULA will come up every time the installer runs. Ensure that this is what you really want to do.

How to disable close button in the ABORT Message box in nsis?

I have used nsi script for creating exe file.In the installation steps I have one message box which shows confirmation dialog box if user wants to cancel the installation.
!define MUI_ABORTWARNING "Are you sure want to abort the installation"
It produces following message box:
In this message box contains disable x close button in the above of the messagebox.now i want to remove that [x] close button.
[or]
Is there any other message box is available to do this job?
NSIS uses the normal MessageBox and that only allows you control the buttons. Close means cancel/no/abort and this is normal windows behavior...
To change this you would need to implement a custom dialog and recompile NSIS.

Need a way to perform auto confirm for firefox or any other browser popup's

Is there a way to auto confirm popup.
For example i'm deleting file via firefox this operation triggers a confirmation popup when the options are ok and cancel.
In this case i need to click on ok button automatically.
Found a way to do this in C#:
Perform the desired action (like delete) and then:
SendKeys.SendWait("{ENTER}"); //in case if the focus was on ok button
SendKeys.SendWait("{TAB}"); //in case if the focus was on cancel button
SendKeys.SendWait("{ENTER}");

Browser Context Menu customization?

Is there a way to override the "undo" and "select all" in right click context menu of the browser over textarea?
Thank you.
You cannot edit the browser's built-in context menu, but you can disable it and replace it with your own using the oncontextmenu event on the window object. I would caution that this is often a bad idea. Users expect to find the built-in context menu and are often frustrated when it isn't there.
I know you can prevent the whole context menu from opening by registering to the click() event, doing some cross-browser mumbo-jumbo to get wich button was clicked, and then return false if the right one was clicked.
However, I don't think it's possible to modify the context menu itself, at least not using javascript.
I should add that you may want to rethink why you're doing this. This will never be a protection against anything (some try to prevent copying images from their website), as it may simply be disabled by turning javascript off.
UPDATE: Ok, so you don't want to prevent users to do things, bug have them doing things your way. Then, I guess the best thing to do is :
Provide users with a toolbar that allow them to do these things (and thus making them use your actions instead of the default one
Map the usual keyboard shortcuts to your actions (Ctrl+A, Ctrl+Z, etc...)
Replace the right click menu with your own.
You mentionned in another comment that you cannot reproduce copy/paste, which is correct, but you can implement you own clipboard (that will only work for your webapp) if you really have to.

Resources