How to restrict an app to run from harddisk

  • Hi,How can I check whether my application is running from Harddisk or from a removable media (CD, USB drive...). I used [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:path isRemovable:&isRem isWritable:&isWritable isUnmountable:&isUnmountable description:&description type:&type] method and used the "isRemovable" parameter to check whether it is removable media or not. It works fine if i directly copy my app to HDD, CD or USB drive. But if I create a disk image of my application and keep it on har disk and then I run my app from disk image the isRemovable parameter still shows that it is running from removable media and that's not true. My purpose is I dont want my user to run my application from Hard Disk. Please suggest some way to achieve this.Thanks & RegardsAbhijeetGet Yourself a cool, short @in.com Email ID now!
  • On May 22, 2012, at 3:50 AM, Abhijeet Singh wrote:

    > ...I run my app from disk image the isRemovable parameter still shows that it is running from removable media and that's not true.

    Well, yes it is. The disk image is unmountable. Maybe the system's definition of removable is different than yours, but really how do you define this for virtual media.

    > My purpose is I dont want my user to run my application from Hard Disk. Please suggest some way to achieve this.

    Inherently stupid, user-hostile, unenforceable requirement--give it up? Or accept the limitation that a disk image is always removable. Or go to extreme lengths to use lower-level calls to determine that the volume is a disk image, then find out where it's located, then check the containing disk type.

    --
    Scott Ribe
    <scott_ribe...>
    http://www.elevated-dev.com/
    (303) 722-0567 voice
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today