Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
Gustav Schubert

How to detect App-Store config at runtime?

Recommended Posts

I want to determine at runtime whether the app was compiled in Normal configuration or Application-Store configuration.

 

Depending on this piece of info I plan to set my internal boolean IsSandboxed property.

 

  • True - show standard dialogs to choose file name.
  • False - read and save directly from/to a known filename according to convention.
{$if defined(IOS) or defined(Android)}
  // Mobile Apps are sandboxed, but my internal IsSandboxed flag needs to be false, ok.
  IsSandboxed := false; // do not show file name dialogs
{$endif}

{$ifdef MACOS}
  // OSX Apps are sandboxed, have permissions set
  IsSandboxed := true; // use dialogs
{$endif}

{$ifdef MSWINDOWS}
  // I myself (dev) don't want to be bothered with the dialogs.
  IsSandboxed := false; // Normal configuration
{$endif}

// pseudo code follows, does not work
{$if defined(MSWINDOWS) and defined(Configuration == App_Store)}
  IsSandboxed := true; // for Windows Store, play it safe, earn full_trust.
{$endif}


( So far I have been reluctant to rename my IsSandboxed property. )

 

But what is the best way to know if my App runs in Application-Store config vs. Normal config?

 

This question applies to VCL apps as well as FMX apps.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×