Programmatically turn on "sending analytics information"

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Programmatically turn on "sending analytics information"

Postby GaryC » Mon Jan 09, 2017 10:49 am

Is there some way to programmatically adjust the Moho setting "Allow sending analtyics information to Smith Micro"?

We want to be able to have a script run to fix up someone's user settings so that they're set to consistent values across the board. Most of them I can find by opening the user.settings file, and I just changed them to values I wanted and compared the new and old versions of the file in Notepad++ for differences in value.

However the analytics setting doesn't seem to appear in there, at least not in any clearly enabled way. We're looking to ensure that everyone has the setting turned on, but can't find where to do that. Does anyone know where this value is or might be stored? Alternatively, a commandline argument to moho or an in program function to turn it on would do the job.
GaryC
 
Posts: 43
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Postby synthsin75 » Mon Jan 09, 2017 7:29 pm

Yeah, I thought that would be in the user.settings file too. Took a bit of hunting, but I found where that setting is stored on Windows (hidden folder):

C:\ProgramData\Smith Micro\Moho\12\Moho12.lic.prefs

The value you want to change is:

"pa_CanSendAnalytics" "FALSE"
- Wes
Image
User avatar
synthsin75
 
Posts: 5535
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Programmatically turn on "sending analytics information"

Postby GaryC » Tue Jan 10, 2017 11:51 am

Aha, that was exactly it yes. I wonder if it's segregated away to try keep name and email safe? Either way, this will let me set it, thanks very much!
GaryC
 
Posts: 43
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Postby synthsin75 » Tue Jan 10, 2017 12:15 pm

Looks like all stuff that's probably set while activating/registering the software. Since the developers know many of us like to mess with the user.settings file (including deleting the whole folder sometimes), they probably thought it safer to hide this stuff elsewhere.
- Wes
Image
User avatar
synthsin75
 
Posts: 5535
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Programmatically turn on "sending analytics information"

Postby GaryC » Thu Jan 12, 2017 7:07 pm

Just back with a similar problem I had thought I'd cracked.

I was also trying to set up a folder to appear in library assets, but not having any luck. I did find a SourceRoots.json file in the AppData folder, stored alongside the user.settings file. It contains JSON data that has a few fields for references, so I tried to insert a reference to a folder with data like this:

Code: Select all
LIBRARY = {"path": "C:/Path/to/Library",
               "relativeTo": "Custom",
               "name": "_My_Library"}


But that doesn't seem to actually include the folder in the library. As far as I can see, this does seem to match the format of folders being imported through the Moho UI. So there must be some other file somewhere that also needs to be amended?
GaryC
 
Posts: 43
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Postby synthsin75 » Thu Jan 12, 2017 7:21 pm

Is it an existing folder? Did you restart Moho after the change?
- Wes
Image
User avatar
synthsin75
 
Posts: 5535
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Programmatically turn on "sending analytics information"

Postby GaryC » Fri Jan 13, 2017 6:16 pm

Yeah it's a real folder. I even just did a manual import of the folder on one computer to make sure that I was matching the format the file is normally written in. I have Moho closed while the script runs, editing the appdata files. So it's been closed and reopened multiple times with no change. The folder information is in the SourceRoots.json file when I open it in Notepad, but it doesn't seem to have any effect on what folders are in the library.

It's a network share folder, but I don't see why that should change anything since the path still matches what it looks like after a manual import inside of Moho.
GaryC
 
Posts: 43
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Postby synthsin75 » Fri Jan 13, 2017 8:23 pm

What about your "*Custom Content Folder*\Library\_LibraryData\_Locations" or Shared Resources folder?
- Wes
Image
User avatar
synthsin75
 
Posts: 5535
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Programmatically turn on "sending analytics information"

Postby GaryC » Mon Jan 16, 2017 1:57 pm

Ahhh, I hadn't seen the shortcuts stored in that folder. Once I copied in the necessary shortcut it worked with the edit I made to the file.

Thanks again for the help!
GaryC
 
Posts: 43
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Postby synthsin75 » Mon Jan 16, 2017 4:58 pm

Glad that worked. It was just a guess.
- Wes
Image
User avatar
synthsin75
 
Posts: 5535
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma


Return to Scripting

Who is online

Users browsing this forum: Greenlaw and 1 guest