Skip navigation
VMware
Up to Discussions in VMware ThinApp SDK

Developer: VMware ThinApp SDK

This Question is Answered (go to answer)

2 "helpful" answers available (6 pts)
1,471 Views 11 Replies Last post: Aug 23, 2010 2:17 PM by ggeldorp RSS
LucD Guru 8,981 posts since
Oct 31, 2005
Currently Being Moderated

Aug 20, 2010 4:22 PM

Using the ThinApp SDK from PowerShell

For the PowerShell adepts out there, you can use the ThinApp SDK from PowerShell.

See my Using the ThinApp SDK from PowerShell post.

 

 

 

 

____________

Blog: LucD notes

Twitter: lucd22

Master 700 posts since
Feb 29, 2008
Currently Being Moderated
1. Aug 21, 2010 2:33 AM in response to: LucD
Re: Using the ThinApp SDK from PowerShell

Exciting to see you pick up the ThinApp SDK so fast!

 

The target audience isn't restricted to just the Visual Studio folks, we want to make the SDK easily accessible from as many environments as possible, this most certainly includes PowerShell. If there is anything we can do to make life easier in your environment, just let us know and we'll try to accommodate you (example is the missing manifest you mentioned).

 

To prepare the environment, all you need to do is copy ThinAppSDK.dll and ThinAppSDKSrvr.exe to the same directory and run "regsvr32 ThinAppSDK.dll" (from an elevated command prompt). There is no need to manually start ThinAppSDKSrvr.exe. ThinAppSDKSrvr.exe is used when accessing the ThinApp SDK from a 64-bit application and is started automatically by Windows when needed.

 

Perhaps a little technical background: ThinAppSDK.dll is the DLL that implements the ThinApp SDK objects like ThinApp.Management. It is a 32-bit DLL, if you create a ThinApp.Management object from a 32-bit process Windows will load ThinAppSDK.dll into that process (if the DLL was registered correctly with regsvr32). However, it's not possible to load a 32-bit DLL into a 64-bit process. So if you try to create a ThinApp.Management object from a 64-bit process, ThinAppSDK.dll cannot be loaded directly into that process.

That's where ThinAppSDKSrvr.exe comes in. Windows will detect this situation and will automatically launch ThinAppSDKSrvr.exe. Since ThinAppSDKSrvr.exe is a 32-bit application, it can load ThinAppSDK.dll just fine. Windows will then "forward" ThinApp SDK calls (e.g. the GetThinAppType method call) from the 64-bit process to ThinAppSDKSrvr.exe, which will in turn forward it to ThinAppSDK.dll. The result will be passed back from ThinAppSDK.dll to ThinAppSDKSrvr.exe via Windows to the 64-bit application. This might sound complicated, but it all happens behind the scenes, you shouldn't have to worry about it.

 

So, the ThinApp SDK actually does support 64-bit applications. I just tried and launched a 64-bit PowerShell on Win7 x64. I had no problems running your samples. Not sure why it didn't work for you.

kailashgajara Novice 5 posts since
Aug 23, 2010
Currently Being Moderated
3. Aug 23, 2010 10:53 AM in response to: LucD
Re: Using the ThinApp SDK from PowerShell

 

Hi,

 

 

I am getting this error after running the first simple script:

 

 

File C:\..\..\ThinAppSDK-1.ps1 cannot be loaded because the execution of scripts

is disabled on this system. Please see "get-help about_signing" for more details.

At line:1 char:59

+ C:\...\...\ThinAppSDK-1.ps1 <<<<

    + CategoryInfo          : NotSpecified: ( [], PSSecurityException

    + FullyQualifiedErrorId : RuntimeException

 

 

My system is Win 7 , 64 bit.

 

 

Thanks.

 

 

kailashgajara Novice 5 posts since
Aug 23, 2010
Currently Being Moderated
5. Aug 23, 2010 11:26 AM in response to: LucD
Re: Using the ThinApp SDK from PowerShell

 

Thanks LuCD. I did that. "Set-ExecutionPolicy Unrestricted"

 

 

I am getting "Exception calling "OpenPackage" at $package = $thinMgmt.OpenPackage($sampleApp)

 

 

Master 700 posts since
Feb 29, 2008
Currently Being Moderated
6. Aug 23, 2010 11:30 AM in response to: kailashgajara
Re: Using the ThinApp SDK from PowerShell

The script has the ThinApp package hard-coded in:

 

$sampleApp = "C:\ThinApp\XmlPad3\bin\XmlPad.exe"

 

Do you actually have a package at C:\ThinApp\XmlPad3\bin\XmlPad.exe? If not, replace by the path to one of your own packages.

kailashgajara Novice 5 posts since
Aug 23, 2010
Currently Being Moderated
7. Aug 23, 2010 11:36 AM in response to: ggeldorp
Re: Using the ThinApp SDK from PowerShell

Yes, I do. Actually I am wondering whether SDK is succesfully loaded or not. I hope  regsvr32  ThinAppSDK.dll is sufficient for Setup on Win 7 64 bit.

kailashgajara Novice 5 posts since
Aug 23, 2010
Currently Being Moderated
9. Aug 23, 2010 1:13 PM in response to: LucD
Re: Using the ThinApp SDK from PowerShell

Yes, I do. I have both .dll and .exe file in same folder. (It comes as it is while downloading SDK.) I enabled UAC and ran command regsvr32 ThinAppSDK.dll , and it gives me popup that it succeeded. But MSInfo32 doesn't show anything.

Master 700 posts since
Feb 29, 2008
Currently Being Moderated
11. Aug 23, 2010 2:17 PM in response to: kailashgajara
Re: Using the ThinApp SDK from PowerShell

If you got to the "OpenPackage" call then registration succeeded, otherwise you wouldn't get past the New-Object call.

Can you post the complete error message that you get when OpenPackage fails? There should be more information after the "exception" stuff.

Bookmarked By (0)

Communities