Determine wether project is running in ZennoPoster or ProjectMaker

Maddis

Новичок
Регистрация
22.10.2018
Сообщения
26
Благодарностей
3
Баллы
3
Is there a way to determine this?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 769
Благодарностей
1 179
Баллы
113
Hi, what do you mean projects running in poster or PM? We create projects in PM and then run in poster.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 189
Благодарностей
5 830
Баллы
113

Maddis

Новичок
Регистрация
22.10.2018
Сообщения
26
Благодарностей
3
Баллы
3
Sorry, I should have explained it in more detail. I needed to have a different set of variables while testing in Project Maker so needed to check programmatically.

I think this will work:
// Check Running Environment

string Environ = project. Context.ToString();

if (Environ.Contains("Manipulator"))
{
Running In ZennoPoster Mode
    
project. Variables["project_HomeFolder"]. Value = ("D:\\VM's\\PC\\Shared\\Richard Monnier");
project. SendInfoToLog("Runing in ProjectMaker mode", true);
    
}
else
{
Running In ZennoBox Mode
    
}

return 1;
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 769
Благодарностей
1 179
Баллы
113
You can save variables in profile file, maybe that helps. So you can load different profile when you run in PM.
You can also get program path and then regex what program name is:

C#:
return AppDomain.CurrentDomain.BaseDirectory;
 
  • Спасибо
Реакции: Maddis

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)