PDA

View Full Version : IF THEN statements?


Nocturnal
02-12-2009, 03:58 AM
I'm trying to build something that will a) ask me "Do you want to install, YES OR NO?" with either a Yes button or a No button.

If I click on yes, I want it to go on to the next action which will be installing several programs.

How do I accomplish this? I've already got the dialog box down. Thanks!

jackdaniels
02-12-2009, 05:07 AM
this will get you started...

result = Dialog.Message("Installation", "Do you want to install ?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
--if they choose yes
if result == IDYES then
--install app
return true;
else
--dont install
return false;
end

rexzooly
02-14-2009, 04:03 AM
I'm trying to build something that will a) ask me "Do you want to install, YES OR NO?" with either a Yes button or a No button.

If I click on yes, I want it to go on to the next action which will be installing several programs.

How do I accomplish this? I've already got the dialog box down. Thanks!

if you look the dialog as options to be able to yes no, ok & Concel and so on :yes

Good luck.

motoman
04-01-2009, 10:44 AM
so I have the following:

result = Dialog.Message("Installation", "Did you remove any existing antivirus software via ADD/REMOVE PROGRAMS in Control Panel?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
--if they choose yes
if result == IDYES then
--install AutoPlay\\Docs\\SophosHomeInstall.EXE
return true;
else
--dont install
return false;
end


I get the dialog box but when I hit YES, it doesnt launch the executable. What did I miss?

jackdaniels
04-01-2009, 12:50 PM
Try like that ;

result = Dialog.Message("Installation", "Did you remove any existing antivirus software via ADD/REMOVE PROGRAMS in Control Panel?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
if result == IDYES then
File.Run("AutoPlay\\Docs\\SophosHomeInstall.EXE", "", "", SW_SHOWNORMAL, false);
else
return false;
end

motoman
04-01-2009, 01:46 PM
that worked man. thanks