Programmatically turn on "sending analytics information"

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Programmatically turn on "sending analytics information"

Post by GaryC »

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.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Programmatically turn on "sending analytics information"

Post by synthsin75 »

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"
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Post by GaryC »

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!
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Programmatically turn on "sending analytics information"

Post by synthsin75 »

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.
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Post by GaryC »

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?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Programmatically turn on "sending analytics information"

Post by synthsin75 »

Is it an existing folder? Did you restart Moho after the change?
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Post by GaryC »

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.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Programmatically turn on "sending analytics information"

Post by synthsin75 »

What about your "*Custom Content Folder*\Library\_LibraryData\_Locations" or Shared Resources folder?
GaryC
Posts: 53
Joined: Tue Feb 03, 2015 1:02 pm

Re: Programmatically turn on "sending analytics information"

Post by GaryC »

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!
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Programmatically turn on "sending analytics information"

Post by synthsin75 »

Glad that worked. It was just a guess.
Post Reply