myTrustFiles.cfg EXPERTS -- 1,000 points

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 ?

DonelsonAsked:
Who is Participating?
 
wings_gauravCommented:
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
 
Ramy_atefCommented:
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
 
DonelsonAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Ramy_atefCommented:
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
 
DonelsonAuthor Commented:
Okay, I will give this a go and see what happens!
0
 
DonelsonAuthor Commented:
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
 
DonelsonAuthor Commented:
In fact, there is NO directory on my XP Pro PC named

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

0
 
Ramy_atefCommented:
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
 
DonelsonAuthor Commented:
Okay

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

Only macromedia.com and #SharedObjects

0
 
DonelsonAuthor Commented:
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
 
DonelsonAuthor Commented:
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
 
Ramy_atefCommented:
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
 
DonelsonAuthor Commented:
$300 !!!!

No way for just one function.

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

0
 
Ramy_atefCommented:
working on it
0
 
DonelsonAuthor Commented:
Ramy, Eeeeexcellent!
0
 
wings_gauravCommented:
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
 
wings_gauravCommented:
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
 
Ramy_atefCommented:
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
 
DonelsonAuthor Commented:
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
 
DonelsonAuthor Commented:
Wings

Thanks.  Please post on Questions:

Q_21873896.html and Q_21873535.html
0
 
wings_gauravCommented:
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
 
DonelsonAuthor Commented:
I have created a very flexible installer at

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

Freeware Beta
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.