PDA

View Full Version : Install Flash automagicly if not detected



alias
12-18-2002, 08:37 PM
Hello i am new here and i have a question about Installing the flash player when the users hit a page it will run the following code i have no problems getting the variables to detect flash version and run then install but the object is not visible right away so i have implimented a page reload command this works good also except when the page reloads it reruns the script and goes through the installation again any suggestions? here is the easy to read version and long versions of my code

this is an on initialize event

//check for flash and install
IF[%Flashversion%] >=6.0.0.0]
ELSE
%result% = Dialog.MessageBox ["Flash not detected","some text goes here yes no blah blah

//comment
IF[%result% = NO]
RETURN
END IF

File.Execute["%SrcDrv%\appname.exe blah blah","",Wait]

//another comment
Page Reload
END IF


ok and now the full copy and paste code

<IR_ACTIONS_LIST>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>this will check for and install flash player from cd if neccesary</Comment>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%FlashVersion% &amp;gt;= 6.0.0.0</Condition>
</Action>
<Action name="ELSE">
<Type>206</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Message Box">
<Type>5</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<DialogTitle>Flash not Detected</DialogTitle>
<DialogMessage>It appears you do not have a new enough version of the Flash Active X control installed would you like to install flash player now? If you choose no you will not be able to view some of the content on this cd.</DialogMessage>
<Icon>1</Icon>
<Variable>%Result%</Variable>
<DialogType>1</DialogType>
<DefaultButton>0</DefaultButton>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>if user said no quit doing any more</Comment>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%Result% = no</Condition>
</Action>
<Action name="RETURN">
<Type>207</Type>
<Function>1</Function>
<DTIndentLevel>3</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>if user said yes install flash player</Comment>
</Action>
<Action name="Execute">
<Type>8</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<FileName>%SrcDir%\Applications\Flash\Shockwave_Installer_Fu ll.exe</FileName>
<CommandLine/>
<WorkingDir/>
<RunMode>0</RunMode>
<WaitForReturn>1</WaitForReturn>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>this will reload the page then exit to normal</Comment>
</Action>
<Action name="Reload">
<Type>104</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
</IR_ACTIONS_LIST>


thanks regards for any info given

francisq
12-18-2002, 09:11 PM
I would guess that a Windows restart might be necessary to get the thing properly installed - suck it and see

alias
12-18-2002, 09:19 PM
it works fine if the cd is stopped and restarted with no reboot of windows the flash works fine even without restarting the cd but it still prompts the user to install even after it is installed is there maybe a registry thing to look for or what ??

francisq
12-18-2002, 09:29 PM
Probably the FlashVersion variable is initialized when autorun starts up :-((
Why not just assume that the install went OK and use a %FlashInstallDone% variable?
Set it to 0 On Project Init
test it at the beginning on On Page Init and jump over the install
set it to 1 when you return from the install wait

Corey
12-18-2002, 10:15 PM
Why not set a variable when you install flash, i.e. %installed% = yes then just set your page to skip the flash check process with an IF statement whenever that variable is set to "yes". That'll work...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

alias
12-19-2002, 12:42 PM
Thank you Corey the %installed% variable worked i may not have done it the right way but it worked

i inserted the

%installed% = yes after the install wait was completed
then inserted an if statement to see if it = yes if = yes end if
else goto and run my existing script

so the new quick version looks like

this is an on initialize event

//check for flash and install
IF[%installed% = yes
ELSE

IF[%Flashversion%] >=6.0.0.0]
ELSE
%result% = Dialog.MessageBox ["Flash not detected","some text goes here yes no blah blah

//comment
IF[%result% = NO]
RETURN
END IF

File.Execute["%SrcDrv%\appname.exe blah blah","",Wait]
%installed% = "Yes"

//another comment
Page Reload
END IF
END IF


so thank you again very good show

another note i just want to add i really enjoy using your software the new 4 is nice and sleek compared to 3 and the extra functionality is another great thing

Corey
12-19-2002, 02:15 PM
Cool, thanks for the comments...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

crvideo
01-15-2003, 06:59 PM
this is all really good information... I'm just not sure about EXACTLY how to implement this... can you provide a semi step-by-step how to?

just to clarify so we're on the same page... i'm trying to set it up so that autoplay will install my file "InstallAXFlash.exe" automatically, and transparent to the user when the cd starts up.

thanks

Corey
01-15-2003, 09:08 PM
You lost me, please explain what you are asking for, thanks.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)