PDA

View Full Version : Launch Program (SF 6 vs. 7)



vancez
09-20-2005, 06:55 PM
I just upgraded from Setup Factory 6 to SF 7 and was surprised to see there was no simple option for adding a "Launch Program" option on the Finish screen.

Looking at my old SF6 files, that option is in there and I don't remember having to handcode it.

Is there a simple way to add this obvious option to the Finish screen? I saw some other posts mentioning a checkbox screen and adding custom actions. The action shown in my SF6 file is "Execute". I don't even see that in the list of available actions in SF7.

I'm a product manager, not a coder. I use SF so I don't have to program. Maybe I'll have to code to add this option?

Thanks,
Vance

Corey
09-20-2005, 07:17 PM
Hi, I might be misunderstanding but it seems like one could use a custom screen, attached is a modified finish screen, simply unzip it to your Setup Factory > Screens folder, preview attached. There may be a better way, this is just one idea, I'm not an expert on Setup Factory.

vancez
09-20-2005, 07:34 PM
Hi, I might be misunderstanding but it seems like one could use a custom screen, attached is a modified finish screen, simply unzip it to your Setup Factory > Screens folder, preview attached. There may be a better way, this is just one idea, I'm not an expert on Setup Factory.

Corey,

Thanks for the screen. I came up with something similar, but the piece I'm missing is the code that checks if the checkbox is enabled and then executes a program. I see how it's done in SF6 but I don't see the "Execute" command in SF7.

I'm surprised that "Launch Program on Finish" isn't a built-in option.

Vance

Corey
09-20-2005, 07:51 PM
Hi. I don't have Setup Factory handy but it would be something like this (on the active button):

if (checked01) then
result = File.Run(_TempFolder.."\\yourfile.exe", "", "", SW_SHOWNORMAL, false);
end

Where "checked01" is the name of the Lua variable assigned to your checkbox (in the screen edit dialog) and "yourfile.exe" is the program you wish to launch.

Manikandan
05-28-2007, 05:45 AM
Hi

At the end of the install when you click Finish it closes the Startup Factory window and launches another that says "Run Program Now" Using check box.

When i select Checkbox it shoold RUN the Application other wise should complete Installation in asusual mannaer.

My Code


tCheck01 = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_01);

if tCheck01.Checked then
File.Run(SessionVar.Expand("%AppFolder%\\NoodleNet .exe"), "firstrun", "")
end

Screen.Next();

But the above code its not working Could you please any one to give a colution on this to me move FWD


Regards
Manikandan

Adam
05-30-2007, 04:43 PM
File.Run(SessionVar.Expand("%AppFolder%\\NoodleNet .exe"), "firstrun", "")

Is there supposed to be a space between NoodleNet and .exe? There should never be a space in a filename.

Adam Kapilik

Desolator
05-31-2007, 12:15 AM
AFAIK the forum ads one to prevent XSS.

portlandscreen
06-04-2007, 08:35 PM
This thread speaks to my exact same sentiment and need.

In an earlier version I do seem to recall this being easy.

I just upgraded to 7 but I seldom use SF and I have only the most rudimentary programming skill. Indigo has done such a nice job in making a lot of features accessible to people like me...but not this feature...

Piecing together some of the earlier posts I have successful installed the alternative finish screen. I left the checkbox ID unchanged and my concluding button script is now:

if (checked01) then
result = File.Run("%AppFolder%\\D_MX_Stuff\Living_Langauges.exe", "", "", SW_SHOWNORMAL, false);
end
Screen.Next();

The syntax check is OK, but there is no app launch at the end of my install. I am not even sure how to confirm if I am merey unresolved because of a file path issue.

Please help!

portlandscreen
06-04-2007, 08:44 PM
FYI...I am not leaving empty spaces in my file name. That space was added upon submission of my post by your forum software.

Jason Pate
06-05-2007, 01:53 PM
if (checked01) then
result = File.Run(SessionVar.Expand("%AppFolder%\\D_MX_Stuff\\Living_Langauges.exe"), "", "", SW_SHOWNORMAL, false);
end


%% Varables have to be expanded in code. And \ is always \\ unless you are using an excape charactor.

portlandscreen
06-05-2007, 06:10 PM
Jason thanks for your reply!

I would love to say that your tips made everything work, but I'm still stalled.

You corrected the / to // AND
added code to expand or extract the application file path

so...does the code you provided need further modification?

BTW my result variable for the checkbox stores state in Lua variable: check01

Argh. This is the LAST piece of this project.

portlandscreen
06-05-2007, 06:12 PM
I sure wish Corey's screen also included the final script. Then one could just change the name of the app and be done!

Jason Pate
06-06-2007, 11:58 AM
Fist are you getting into your if statment to verify this I usually add a dialog box inside the if statment. Zip your project and post if you wish.

portlandscreen
06-06-2007, 05:24 PM
I guess there is no reason to post any linked resources or graphics so here it is.

Thanks a ton Jason!

Jason Pate
06-07-2007, 09:32 AM
Try this:


result = File.Run(SessionVar.Expand("%AppFolder%\\D_MX_Stuff\\Living_Langauges.exe"), "", "", SW_SHOWNORMAL, false);

portlandscreen
06-07-2007, 07:13 PM
No, Jason. I tried that and it didn't work.

Actually I had tried that before as well...the directory fashioned as you have it here.

What about the conditional? Is the syntax of the button and the language of the final conditional correct?

Jason Pate
06-08-2007, 11:29 AM
It looked good I will test.

Jason Pate
06-08-2007, 11:36 AM
See if you get a better error with this code, First dialog box just lets you know you made it into loop second is error checking. If it displays check out the path.


if (checked01) then
Dialog.Message("True","")
result = File.Run(SessionVar.Expand("%AppFolder%\\LivingLanguages\\D_MX_Stuff\\Living_L angauges.exe"), "", "", SW_SHOWNORMAL, false);
--Check to see if an error occurred.
error = Application.GetLastError();

-- If an error occurred, display the error message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error].."\r\n"..SessionVar.Expand("%AppFolder%\\LivingLanguages\\D_MX_Stuff\\Living_L angauges.exe"), MB_OK, MB_ICONEXCLAMATION);
end
end

Jason Pate
06-08-2007, 11:38 AM
You can also add a working directory sometimes that helps.


if (checked01) then
Dialog.Message("True","")
result = File.Run(SessionVar.Expand("%AppFolder%\\LivingLanguages\\D_MX_Stuff\\Living_L angauges.exe"), "", SessionVar.Expand("%AppFolder%\\LivingLanguages\\D_MX_Stuff\\"), SW_SHOWNORMAL, false);
--Check to see if an error occurred.
error = Application.GetLastError();

-- If an error occurred, display the error message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error].."\r\n"..SessionVar.Expand("%AppFolder%\\LivingLanguages\\D_MX_Stuff\\Living_L angauges.exe"), MB_OK, MB_ICONEXCLAMATION);
end
end

portlandscreen
06-08-2007, 02:14 PM
Thanks Jason...the debugging code allowed me to get some needed feedback to trace what was happening.

There was a misplaced letter in the file path that was the fly in the ointment.

Having feedback really helps because before I had no way to measure if I was even in the right ballpark with the code. Before today I had no feedback at all to give me a clue. I was shooting into the proverbial darkness.

Thanks, that worked!

Jason Pate
06-08-2007, 03:05 PM
Glad to help, I use dialog box to debug all the time.

owner182109
02-12-2008, 11:03 PM
I think this is useful...thanks:yes:yes:lol