Skip to main content
Inspiring
May 25, 2020
Question

Get location of AE SDK plugin

  • May 25, 2020
  • 1 reply
  • 755 views

Hi. I want to get the location of the plugin via AE SDK, so I can query the file creation time. How would I do this ?

Its better to get it dynamically in case the user has a non-standard path where the plugin is installed.

This topic has been closed for replies.

1 reply

Community Expert
May 25, 2020

this is what i use for mac:

NSString *appParentDirectory = [[[NSBundle bundleForClass:[SomeClassNameUniqueToYourPlugin class]] bundlePath] stringByDeletingLastPathComponent];
 
and for windows:
GetModuleFileNameW((HINSTANCE)&__ImageBase, folderW, MAX_PATH);
 
i'm sure there are other ways, but this works for me.
AnmolMAuthor
Inspiring
May 25, 2020

Thanks. I can understand the char buffer and size values - folderW and MAX_PATH.

What would __ImageBase be ? Is it just the name of the filter I have compiled ? i.e. XXX.aex ?

AnmolMAuthor
Inspiring
May 25, 2020

EDIT:- A simple search helped 🙂

EXTERN_C IMAGE_DOS_HEADER __ImageBase;

....

WCHAR   DllPath[MAX_PATH] = {0};
GetModuleFileNameW((HINSTANCE)&__ImageBase, DllPath, _countof(DllPath));

Thanks a lot Shachar..