[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

myTrustFiles.cfg EXPERTS -- 1,000 points

Posted on 2006-06-05
22
Medium Priority
?
303 Views
Last Modified: 2010-05-19
1,000 POINTS via previous questions Q_21873896.html and Q_21873535.html

I have now read about Flash myTrustFiles.cfg files which may be installed to specify Trusted files for the Flash 8 engine.

BUT... This file uses absolute path names for directories etc.

On PCs (duh!) you have to specify the Drive Letter -- How do you know which drive letter to use for a CD-ROM ?

Or is there some other way to specify the contents of the CFG file ?

0
Comment
Question by:Donelson
  • 12
  • 6
  • 4
22 Comments
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16833550
Hi
I think you can over come the problem by using FlashAuthor.cfg

Creat  FlashAuthor.cfg file in the following approximate directories:

Windows  boot disk\Documents and Settings\<UserName>\Application Data\Macromedia\Flash Player\#Security

Macintosh /Users/<UserName>/Library/Preferences/Macromedia/Flash Player/#Security/

and write this line in it :

LocalSecurityPrompt=Author

PS. this file is automatically installed with one or more Macromedia applications.

so adding this file in a user that doenst' have any macromedia application may solve the problem

Regards,
Ramy
0
 

Author Comment

by:Donelson
ID: 16833643
Ramy

This is bad practice because others may want to write over this file, or it may get reset during Flash engine upgrades.

I need a way to specify that My CD-ROM on WHATEVER drive letter (Stupid Windoze) is Trusted.
0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16833759
well, i don't think that any application will over write this file , and if so it'll make it the same
LocalSecurityPrompt=Author

as this is the default .. so if the user installed flash for example, nothing will go wrong as flash will just write the sme value that we want it to be..
also no need to worry about the upgrade as the folder has nothing to do with the version
.... Macromedia\Flash Player\#Security

it's not Flash Player 8\#Security

Regards,
Ramy
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Donelson
ID: 16833781
Okay, I will give this a go and see what happens!
0
 

Author Comment

by:Donelson
ID: 16833819
Note

Windows  boot disk\Documents and Settings\<UserName>\Application Data\Macromedia\Flash Player\#Security

--> Directory "Application Data" does not exist on my XP Pro system.
0
 

Author Comment

by:Donelson
ID: 16833845
In fact, there is NO directory on my XP Pro PC named

   ....anyFolders.../#Security/....

0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16833864
It's there but it is hidden
to be able to view it , in the windwos explorere , click on Tools > Folder Options .. > View tab
in the advanced settings , scroll down m in the Hidden files and folder, choose Show hidden files and folders
0
 

Author Comment

by:Donelson
ID: 16833897
Okay

......\Application Data\Macromedia\Flash Player\ ----- but no "#Security" folder here

Only macromedia.com and #SharedObjects

0
 

Author Comment

by:Donelson
ID: 16834263
I have created the required folders on a test PC

and the file:  omanCD_ROM.cfg

which contains:

E:\

(E is the drive letter for that PC's CD-ROM drive)

BUT IT DOES NOT WORK. Access is STILL BLOCKED>

0
 

Author Comment

by:Donelson
ID: 16834486
OKAY, got something working.

TO GET POINTS (1,500) please -

1) Provide a way to install  "myFlashProject.cfg"
2) which file contains
  <drive letter>:\
   where <drive letter> is the drive letter of the current CD-ROM for this installer, e.g. "F:\"
3) into the directory
<root>\Documents and Settings\<UserName>\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust/

============

SO, the installer needs to build the file with the current CD-ROM of the installer in it, and then install it into the correct directory, CREATING ANY NEEDED FOLDERS.

If you can provide me with this general <current CD drive> for <current user> installer, you win the points.

0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16834551
Hi
Well if knowing such info will solve your problems... you can use a swf to exe programs , one of the best is :

http://www.multidmedia.com/software/zinc/

it can write files into user's HD and many many other things ..

Regards,
Ramy
0
 

Author Comment

by:Donelson
ID: 16834614
$300 !!!!

No way for just one function.

Isn't anyone qualified to build an installer that can do what I want?

0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16834688
working on it
0
 

Author Comment

by:Donelson
ID: 16834701
Ramy, Eeeeexcellent!
0
 
LVL 5

Expert Comment

by:wings_gaurav
ID: 16835616
vc code
---------------------
#include <windows.h>
#define _WIN32_IE 0x0500
#include <shlobj.h>

// function to check and create file
bool CheckAndCreatePath(char arrPath[])
{
      // read attributes to acertain if the path exists
      if(::GetFileAttributes(arrPath) == -1)
      {
            //if not then create
            if(::CreateDirectory(arrPath, NULL) == FALSE)
            {
                  // return failed creation
                  return false;
            }
      }

      return true;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char * strCmdLine, int nCmdShow)
{
      char arrTargetPath[MAX_PATH + 1];
      char arrCurDrive[MAX_PATH + 1];

      // get path to application data
      ::SHGetSpecialFolderPath(NULL, arrTargetPath, CSIDL_APPDATA, FALSE);

      // add macromedia
      ::strcat(arrTargetPath, "\\Macromedia");
      if(!CheckAndCreatePath(arrTargetPath))
      {
            return 1;
      }

      // add flash player
      ::strcat(arrTargetPath, "\\Flash Player");
      if(!CheckAndCreatePath(arrTargetPath))
      {
            return 1;
      }

      // add #security
      ::strcat(arrTargetPath, "\\#Security");
      if(!CheckAndCreatePath(arrTargetPath))
      {
            return 1;
      }

      // add FlashPlayerTrust
      ::strcat(arrTargetPath, "\\FlashPlayerTrust");
      if(!CheckAndCreatePath(arrTargetPath))
      {
            return 1;
      }

      // add the cfg file name
      ::strcat(arrTargetPath, "\\myFlashProject.cfg");

      // check if already present!
      if(::GetFileAttributes(arrTargetPath) == -1)
      {
            // create the file
            HANDLE hFile = CreateFile(arrTargetPath, GENERIC_WRITE, 0,
                  NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);

            // if error then bug out
            if(hFile == NULL)
            {
                  return 1;
            }

            // get the directory the program is executing from
            GetCurrentDirectory(MAX_PATH, arrCurDrive);

            // truncate to drive letter
            arrCurDrive[3] = '\0';

            // write and close file
            DWORD dwWritten;
            ::WriteFile(hFile, arrCurDrive, 3, &dwWritten, NULL);
            ::CloseHandle(hFile);
      }

      return 0;
}
0
 
LVL 5

Expert Comment

by:wings_gaurav
ID: 16835790
have compiled and tested using vc 6.0. Let me know if you need the compiled exe - i would upload it on shared space.

-wings
0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16836143
C Cdoe

#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>

void myFlashProjectCfgCreate() {

FILE* p
char myFlashProject[MAX_PATH];
char acCurDrive[MAX_PATH];

wsprintf(myFlashProject,"\"%s\\Application Data\\Macromedia\\Flash Player\\#Security\\FlashPlayerTrust\\myFlashProject.cfg\"",getenv("USERPROFILE"));

GetModuleFileName(NULL,acCurDrive,MAX_PATH);
PathStripToRoot(acCurDrive);

p = fopen(myFlashProject,"w");

fputs(acCurDrive,p);

fclose(p);
}

int main () {

myFlashProjectCfgCreate();

return 0;

}
0
 

Author Comment

by:Donelson
ID: 16836912
Is "vc" == Visual C++ ?

I don't have that compiler (unless its built-into XP Pro)

Is it possible to change the name of the output .cfg file Without Re-compiling?

Thanks
0
 
LVL 5

Accepted Solution

by:
wings_gaurav earned 2000 total points
ID: 16840460
yes, vc = vc++.

currently it would require a recompile to change the name of cfg. however, the code can be changed to take the path as a parameter (strCmdLine). Any c++ compiler will do - gnu c++ for example gnu c/c++ with mingw (http://www.mingw.org/)

-wings
0
 

Author Comment

by:Donelson
ID: 16840518
Wings

Thanks.  Please post on Questions:

Q_21873896.html and Q_21873535.html
0
 
LVL 5

Expert Comment

by:wings_gaurav
ID: 16840559
can you try and compile it with gnu c and mingw. If it doesn't work out then i would be able to make the change to make the code parametric and send you the exe.

-wings
0
 

Author Comment

by:Donelson
ID: 16863682
I have created a very flexible installer at

http://www.armchair-travel.com/FlashTrustCD/

Freeware Beta
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question