Offline Activation Helper script

Utilities designed for use with Sandboxie
Post Reply
Mike
Posts: 592
Joined: Mon Nov 16, 2009 1:27 pm

Offline Activation Helper script

Post by Mike » Mon Oct 18, 2010 11:18 pm

ssj100 wrote:Ruhe (since I know you like using batch files to speed things up) or anyone, is there a way (or is it even possible) to make the offline activation method more automatic or faster? Thanks.
With the release of Sandboxie 3.50, it's reactivation time again! This script is for ssj100 and any other users that, for whatever reason, find themselves in an Offline Activation situation.

How might this script help?
- Helps you gather and submit data for all your offline PCs.
- No need to find your license key or remember commands for license.exe.
- Reduces the chance for error due to typos, sloppy handwriting, etc.
- Quicker and easier. Everything controlled from the script UI.

How is the script used?
You'll probably want to run the script from a USB flash drive or something:
  • Task 1) Run it on each offline PC to automatically save your version and syscode to a single .txt file on your flash drive.
    Task 2) Run it on an internet-connected PC to automatically submit data to sandboxie.com, and save the resulting activation keys to the same .txt file.
    Task 3) Run it again on each offline PC to activate.
To make the source code easy for everyone to examine and modify, it's written almost entirely in JScript. It's pretty much ready to run, although you'll want to add your license key to the config section. Download here, as sbie-activation.wsf: http://www.mediafire.com/?j3jua11a9hm71

Mike
Posts: 592
Joined: Mon Nov 16, 2009 1:27 pm

Post by Mike » Mon Oct 18, 2010 11:25 pm

Here are some questions that came up when my guinea pig friends tested this.

Q: Can I run the script sandboxed?
A: Submitting data to sandboxie.com, in Task 2, works great sandboxed. But you can't sandbox Task 1 or 3 on the offline computer because Sandboxie License Manager won't provide a valid syscode. This isn't a problem if you're just testing though - you can just ignore the error.

Q: Will this gunk up my computer?
A: The script creates a single .txt output file in a location you specify. It requires no install and doesn't modify anything else.

Q: How is data submitted to sandboxie.com?
A: Through an automated instance of Internet Explorer, which browses to the offline activation page and fills in the form automatically. (If you want to watch, change objIE.Visible = false; to true. All internet access is managed through the getWwwActKey() function.)

Q: Why can't the script communicate with Internet Explorer in Task 2?
A: If the script is unsandboxed and IE is a forced process, they won't be able to talk. Easiest fix is to run the script sandboxed - see here. Or, follow the instructions in the error message.

Q: Why is my version or syscode garbled in Task 1?
A: The script copies data from Sandboxie by simulating keystrokes - it's best to avoid typing or mousing during this brief process. If running the script again doesn't work, you can try setting CFG_sbAutograb to false in the script config.

Q: Why is the script so long?
A: Had a bit too much fun. Earlier versions provided similar functionality with much less code. A lot of lines are wasted on contingency handling, and figuring out things that could easily be hard-coded. This started as a 10-line batch file.

Q: Why did you do x or y in the code?
A: Probably just to see if I could. Or because I didn't know any better.

SnDPhoenix
Posts: 2690
Joined: Tue Dec 26, 2006 5:44 pm
Location: West Florida

Post by SnDPhoenix » Tue Oct 19, 2010 1:06 am

Ahh, nice script! :D
I personally don't have any issues with activation, but I'm sure this will be useful for those that do (such as ssj100 and that blaq guy)!
If I may make a suggestion though, wouldn't it be better to place this thread in "Contributed Utilities" instead? ;)

ssj100
Posts: 945
Joined: Thu Apr 23, 2009 1:21 am
Contact:

Post by ssj100 » Tue Oct 19, 2010 1:09 am

Thanks Mike. I probably won't be using it, as I don't have any issues with activation either. I was just thinking about "worst case scenarios".

Looks like great work though. Might test it out when I get time.
Sandboxie + SUA + DEP
Windows Firewall + NAT Router
Drive SnapShot (on-demand)

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Tue Oct 19, 2010 8:39 am

Mike wrote:Q: Why is my version or syscode garbled in Task 1?
A: The script copies data from Sandboxie by simulating keystrokes - it's best to avoid typing or mousing during this brief process. If running the script again doesn't work, you can try setting CFG_sbAutograb to false in the script config.
The License.exe program supports batch/scripting use with the "silent" modifier, are you aware of this?

Code: Select all

"C:\Program Files\Sandboxie\License.exe" silent print syscode | more

Code: Select all

"C:\Program Files\Sandboxie\License.exe" silent print version | more
But maybe you just had more fun doing screen scraping. :)
tzuk

Mike
Posts: 592
Joined: Mon Nov 16, 2009 1:27 pm

Post by Mike » Tue Oct 19, 2010 10:53 am

SnDPhoenix wrote:If I may make a suggestion though, wouldn't it be better to place this thread in "Contributed Utilities" instead?
SnD, thanks for trying it. I wouldn't mind moving this to Contributed Utilities, but for some reason I thought those had to meet a certain standard... maybe because tzuk curates this list, http://www.sandboxie.com/index.php?ContributedUtilities?
ssj100 wrote:Thanks Mike. I probably won't be using it, as I don't have any issues with activation either. I was just thinking about "worst case scenarios".
Oh, I see, thanks for checking in though. Anyway, this was more for kicks than anything else.
tzuk wrote:The License.exe program supports batch/scripting use with the "silent" modifier, are you aware of this?
D'oh! That definitely falls into the "didn't know any better" category. I tried license /? and got nothing, checked the corporate install page, and I guess I missed this thread. Thanks for the tip, tzuk - maybe I'll update the code if anyone has problems.

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Tue Oct 19, 2010 6:30 pm

I don't mind moving this to the Contributed Utilities forum. As for updating the Contributed Utilities web page, I guess we'll see the reaction to this utility over some period of time, and then decide.
tzuk

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests