Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read from registry!

Status
Not open for further replies.

kentgran

Programmer
Dec 12, 2001
1
NO
Is it possible to read registry-keys from a Flash Projector?
I'm making a menu for an installation-CD and I wish to determine if the programs have been run before..
Alternatively I can make a 'secret'-file with executing a batch-job and then check for that 'Hard-coded' file, but then the feature will be locked to the c-drive... or could I possibly read out the system-dir from somewhere?

-Kent
 
I think your best bet is going to be to use something like vb, c or something to write a little prog. that does a registry detect, like you said.

=)

PetitPal.
 
hi Kent

You probably won't get this because you have no e-mail notification, but what the heck....

A way around this problem is to use the FScommand "save". Your syntax would look something like this:

fscommand ("save","C:\\yourfile.txt");

...which saves a text file to the root folder of the user's C-drive, the saved file contains all the main timeline variables. So when the user runs each program all you have to do is set the corrresponding variable to "installed" (for example) and then perform the 'save' action.

To check if a program has been installed then just use loadVariables action to load in the saved variables, each time the user tries to install something you'll be able to check if it has been installed.

Full coding would be something like:

//first frame of movie, main timeline, load in text file

loadVariables("C:\\yourfile.txt", 0);

//action on 'run' button for program1
on (release){
if (/:program1_run="installed"){
/:warning="already installed";
//where /:warning is a dynamic text field (or whatever, something which tells the user that the program has been run)

}else{
/:program1_run="installed";
//then whatever action you want to perform for program 1
}

You might want to give the user the option to use this method though, as obviously some people will be wary of a new file on their c-drive. This method will also NOT create new folders, so if your targetting a folder within the user's c-drive it must exist already.

You also dont have to call it a txt file, you can have whatever extension you want, as Flash will always just read the contents of the file regardless. Having said that, it is probably better in this case to save it as a straight text file as it does not contain anything miraculous. Better to let them see what it is than have them delete a suspicious looking file. Basically, a method to be used with respect.

I hope this is kinda what you were after, if not you'll probably find a use for it somewhere down the line.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top