Jump to content

Windows WPA with COM


Recommended Posts

Ever wanted to change your Windows key with a script, or to activate Windows after your unattended install is done?! Maybe this is something for you...

- info at http://msdn.microsoft.com/library/default....tactivation.asp

- still needs some testing and code improvement

- currently (March,09,2005) this works only with development version of autoit

- get beta from http://www.autoitscript.com/autoit3/files/...toit-v3.1.0.exe

- then get the newest build from http://www.hiddensoft.com/fileman/users/jpm/AutoIt3-gui/ and extract the zip file in the autoit folder

- replace c:\Programme\AutoIt3\Aut2Exe\AutoItSC.bin with the one from the ZIP file you downloaded from http://www.hiddensoft.com/fileman/users/jpm/AutoIt3-gui/ to be able to compile the scripts to working exe files

Some examples:

#include <wpa.au3>

; if you can test any of the functions, please tell me, or post in forum

; Tested means: I tried it, and the results were as expected
; Untested means: i could not (yet) test it, or i am not sure if the results are correct

;Tested
MsgBox(0, "DecodeProductKey", _WPA_DecodeProductKey (_WPA_getBinaryDPID_OFFICEXP ()))

;untested
MsgBox(0, "DecodeProductKey", _WPA_DecodeProductKey (_WPA_getBinaryDPID_VS2003 ()))

;Tested
MsgBox(0, "DecodeProductKey", _WPA_DecodeProductKey (_WPA_getBinaryDPID_WINDOWS ()))

;Tested
MsgBox(0, "DecodeProductKey", _WPA_DecodeProductKey (_WPA_getBinaryDPID_OFFICE2K3 ()))

;Tested
MsgBox(0, "ActivationRequired", _WPA_ActivationRequired ())

;Unested
MsgBox(0, "Description", _WPA_Description ())

;Untested
MsgBox(0, "Caption", _WPA_Caption ())

;Tested
MsgBox(0, "IsNotificationOn", _WPA_IsNotificationOn ())

;Tested
MsgBox(0, "RemainingEvaluationPeriod", _WPA_RemainingEvaluationPeriod ())

;Tested
MsgBox(0, "RemainingGracePeriod", _WPA_RemainingGracePeriod ())

;Tested
MsgBox(0, "ServerName", _WPA_ServerName ())

;Untested
MsgBox(0, "SettingID", _WPA_SettingID ())

;Untested
;Msgbox(0,"ActivateOffline",_WPA_ActivateOffline("2112312-232312-1231232"))

;Untested
;Msgbox(0,"ActivateOnline",_WPA_ActivateOnline())

;Untested
MsgBox(0, "GetInstallationID", _WPA_GetInstallationID ())

;Untested
MsgBox(0, "SetNotification", _WPA_SetNotification (1))

;Tested
;$key="ENTER-SOMEK-EYHER-ETOTE-STIT!"
;Msgbox(0,"SetProductKey",_WPA_SetProductKey($key))

Please help me test, improve, and document so we can make it an UDF as soon as possible

Some advanced examples would be nice...

EDIT: updated the post to newest version of the UDF

wpa.au3

wpa_Example.au3

Edited by WPA-Fan
Link to comment
Share on other sites

Ever wanted to change your Windows kex with a script, or to activate Windows after your unattended install is done?! Maybe this is something for you...

....

Geez,

I AM amazed.. The COM code is released only 4 days ago, and now already a complete UDF has been written for it...

Good work "WPA-Fan".

However, keep in mind that the COM code is still in a 'deep' beta-state. Only a few weeks ago I changed the script COM function names into ObjGet, ObjCreate(),....

Before that they were named like their VBscript counterparts CreateObject(), GetObject(), ...

Not that I have plans to change the script function names again..but you will never know about this beta stuff..

So be careful with beta's, don't pin your UDF's onto it.

Keep up the good work. I like the COMments. ;-)

Regards,

-Sven

Link to comment
Share on other sites

I AM amazed.. The COM code is released only 4 days ago, and now already a complete UDF has been written for it...

Good work "WPA-Fan".

thanks ! :)

However, keep in mind that the COM code is still in a 'deep' beta-state.

yes, i know, but i needed these functions for a script i use, and so i thought why not make a comlete udf...

Before the COM code existed i had to use VBS scripts created by my autoit script... I did not like this, and as soon as i saw the new COM support i started getting rid of my VBS scripts:-))

Thanks for these new possibillities...lets hope it will soon become "stable", so that all users of AU can use it, soon...

Edited by WPA-Fan
Link to comment
Share on other sites

Sorry, if this is a stupid question, but i am new to this:

Is it normal that I can use the new stuff like COM support in my scripts, but compiling it is not possible?! Dos this have to do with the part of the Autoit code that is not public (i mean do we have to wait for Jon to integrate COM support to make an exe?)

BTW: attached a new version of my WPA stuff (see first post !)

Is there someone out there willing to test the new functions for Visual Studion 2003 and for Office XP ?? Please:-))

edit: added new version to first post, so everyone will use the latest version only..

Edited by WPA-Fan
Link to comment
Share on other sites

i think you have to replace the AutoITSC.bin file and put it in the regular AutoIt folder like C:\Program Files\AutoIt3\ or whatever u have it as... (your talking about the newest beta in the Dev section right? cause if u r, then the AutoItSC.bin file, just put that in your normal autoit folder, but backup the old copy, then try and compile it) i think thats what you do, not sure so wait for someone to approve of it :)

FootbaG
Link to comment
Share on other sites

well compiling works ok, but when i try to run the exe i get an error "cannont parse the line"

The same happends with the COM examples that come with this version...so it is probably not my code that has any mistakes....

@Sven P: any hints on this? Is it your code, or just that we need to wait for Jon to add COM support to the compiler?!

Edited by WPA-Fan
Link to comment
Share on other sites

well compiling works ok, but when i try to run the exe i get an error "cannont parse the line"

The same happends with the COM examples that come with this version...so it is probably not my code that has any mistakes....

@Sven P: any hints on this? Is it your code, or just that we need to wait for Jon to add COM support to the compiler?!

<{POST_SNAPBACK}>

Compiling and running the exe, seems ok for me. Did you do what Layer stated, by replacing your installed files with the beta versions? You maybe still using the stable *.bin file, to be receiving errors?
Link to comment
Share on other sites

O.K.: I just uninstalled Autoit

Then i downloaded:

http://www.autoitscript.com/autoit3/files/...toit-v3.1.0.exe

and installed it (i did not download the latest beta, as the following file is older than the newest beta, so it would not fit together)

Then i downloaded http://www.hiddensoft.com/fileman/users/jp...It3.1.0.15I.zip and unzipped the files in the autoit dir overwriting existing files.

A Filecompare between the AutoItSC.bin from http://www.autoitscript.com/autoit3/files/...toit-v3.1.0.exe

and the one from http://www.hiddensoft.com/fileman/users/jp...It3.1.0.15I.zip shows that these files are identical, so it will not matter which one i have...

Running scripts like C:\Programme\AutoIt3\tests\com\WmiDisk.au3 works, but when i compile it, the exe does not work, it gives me an error as described above...

Any Hints? Please !

Link to comment
Share on other sites

A Filecompare between the AutoItSC.bin from http://www.autoitscript.com/autoit3/files/...toit-v3.1.0.exe

and the one from http://www.hiddensoft.com/fileman/users/jp...It3.1.0.15I.zip shows that these files are identical, so it will not matter which one i have...

Running scripts like C:\Programme\AutoIt3\tests\com\WmiDisk.au3 works, but when i compile it, the exe does not work, it gives me an error as described above...

Any Hints? Please !

AutoitSC.bin is located in the Aut2Exe folder, within the installed Autoit3 directory.

The filesize of of it with version 3.1 is 249kb. The beta version is 315kb.

Ensure, that you are inserting the beta files, into the correct locations.

AutoIt3.exe -> AutoIt3\
AutoIt.chm -> AutoIt3\
AutoItSC.bin -> AutoIt3\Aut2Exe\
Constants.au3 -> AutoIt3\Include\
GUIConstants.au3 -> AutoIt3\Include\
Link to comment
Share on other sites

Ah, thats it...thank you !!! Now everything works as expected...

<{POST_SNAPBACK}>

It seems that it has all been solved without my help :-)

Well this is the kind of things you will run into when using a pre-beta version. And it might get worse....the 3.1.0.15I version does not contain the document that describes what is still wrong with the COM code. ;-)

1. I haven't checked the code for memory leaks (that is, memory being allocated but not being free'd)

2. When using ADSI Objects, things get a bit unstable: The .filter() method seems to produce irradic behaviour and FOR..IN loops on ADSI collections might give you an exception error.

3. The COM code does not yet support arguments to be passed 'by Reference'. Functions that depend on it, do not work (like WMI's GetStringValue())

4. The COM code does not yet support boolean-type arguments. Functions that depend on it, do not work (like shell.application's ServiceStop())

5. There might be a lot more bugs that I haven't run in to yet.

Regards,

-Sven

Link to comment
Share on other sites

  • 10 months later...

Why not use the windows revision independed PROGID then there should be no fuzz - all components has an revision independed entry that can be used instead of the real PROGID...

Example: OWC.Spreadsheet.9 // and the revision independed PROGID: OWC.Spreadsheet

kjactive :lmao:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...