View Full Version : [App] [Apr-26-09] WM6.5 Plug-in Installer
AppStar
27th April 2009, 03:56 AM
AppStar Titanium
Plug-in Installer
This program allows chome/titanium plug-in developers to create a cab file that will insert the plug-in's markup into the cpr files depending on the device's resolution and update the registry without overriding any of the user's existing chome/titanium configuration files or settings.
Device Requirements:
1. WM 6.5
2. .Net CF 2.0 or higher
Usage:
First things first, this is a developer only tool that has strict requirements to work properly. It requires a few files to be deployed and files like the plg files are case sensitive. ATPluginInstaller.exe and CESetupDLL.dll can be used for any free, not for profit, chome/Titanium plug-in.
Ok, now onto the fun stuff...
ATPluginInstaller.exe is the program where most of the magic happens. It does a few important things. First, it adds a plug-in name to the registry in "HKEY_LOCAL_MACHINE\Software\Microsoft\CHome:Plugin s" and also inserts the plug-in into the specified location in "HKEY_LOCAL_MACHINE\Software\Microsoft\CHome:Extens ibilityXML" and "DefaultXML". Then it clears all VALUES in "HKEY_LOCAL_MACHINE\Security\CHome\DefaultSettings" to prevent chome from reverting to an old layout. Finally it injects the appropriate markup for the device resolution into each of the Titanium CPR files.
For ATPluginInstaller.exe to know what plug-in and markup to use, it needs a PLG file. A PLG file is basically a pre-defined XML file that includes the name, position, and markup for the plug-in you want to install.
Begining of a sample PLG file:
<?xml version="1.0" encoding="utf-8" ?>
<plugin>
<name>ATFavePeople</name>
<position>2</position>
<layouts>
<layout screenWidth="240" screenHeight="320">
<!-- ATFavePeople -->
<Layer ID="ATFavePeopleExpanded" Visible="False" Width="240" Height="82" Clip="False">
<Layer ID="Page" Clip="False">
<!-- Icon on upper right -->
<Image ID="Icon" Left="188" Top="-13" Width="43" Height="57" ScaleStyle="Stretch"/>
<!-- Large picture in Center -->
<Image ID="ContactPhoto" Left="10" Top="17" Width="43" Height="43" ScaleStyle="Fit" Clip="False">
<Layer ID="Border2" Color="#FFFFFFFF" Left="-2" Top="-2" Width="90" Height="90" Visible="True"/>
</Image>
(abbreviated to conserve space...)
The root node is "plugin". The three sub-nodes are "name", "position", and "layouts". All nodes must follow case to work with ATPluginInstaller.exe.
The "name" node contains the name of the plug-in you wish to install. It must match the name used in the plug-in markup.
The "position" node specifies where you want the plug-in to be displayed on chome. It is 0 based. Meaning the first spot is 0, the second spot is 1, and so on. If a number greater than the number of currently installed plug-ins is used, then the plug-in will be displayed at the bottom of chome.
The "layouts" node contains all the plug-in markup for the different device resolutions. Each resolution is defined by a "layout" sub-node with two attributes. The attributes are "screenWidth" and "screenHeight" which define what "layout" sub-node to use for each resolution. The "layout" sub-node contains the markup that will be injected into the CPR files. This markup is also case sensative and must follow the case that is used by Microsoft in the default CPR files or the sample attached PLG file.
To install a plug-in, simply call ATPluginInstaller.exe followed by the "-i" parameter and a space and then the PLG file name.
example: ATPluginInstaller.exe -i default.plg
ATPluginInstaller.exe is also uninstall friendly. Just replace "-i" with "-u".
example" ATPluginInstaller.exe -u default.plg
Well that's fine and dandy, but how the hell do I call ATPluginInstaller.exe from my CAB file? That's where a setup DLL comes into play. A setup DLL allows you to execute additional functions after a program is installed and before it is uninstalled. Working with setup DLLs are a pain in the butt because they don't support managed code, only C++. So I've attached CESetupDLL which is a setup dll that does two things:
1. It calls ATPluginInstaller.exe and installs, "-i", default.plg from the folder where the application is deployed to.
2. It calls CHomeRefresh.exe from the folder where the application is deployed to, to update Chome without performing a restart. (I didn't write CHomeRefresh and don't know who did but it works fairly well.)
CESetupDLL also works for CAB uninstall.
To include your CESetupDLL.dll in the INF file (file used to build installation CAB file) you have to add the following string to the [DefaultInstall] section:
CESetupDLL = "CESetupDLL.dll"
You can read more about setup.dlls here:
http://www.pocketpcdn.com/articles/setupdll.html
http://msdn.microsoft.com/en-us/library/aa924308.aspx
That's pretty much it! Remember to pay attention to case, and if you use my CESetupDLL.dll include ATPluginInstaller.exe, default.plg, and CHomeRefresh.exe to your program folder in your CAB.
Feel free to use ATPluginInstaller.exe and CESetupDLL.dll for any free, not for profit, chome/Titanium plug-in. Giving me some credit would be nice too. ;-)
showaco
27th April 2009, 04:32 AM
Cool, thanks for this.
Let me make sure of the default.plg file, if I want to include cpr installs for different resolutions, I just add all of them to that one file, correct? Just change the layout screenwidth,screenheight for each new cpr I need to write, for both portrait and landscape. So for vga only, I would have two layout sections, one with screenwidth=480, screenheight=640 and then another layout with screenwidth=640, screenheight=480? If a cpr doesn't exist on device, then it just skips that one and goes to next?
Just wanted to make sure I understood it correctly as I plan on updating titaniumweather this week and wanted to use this.
AppStar
27th April 2009, 04:57 AM
Cool, thanks for this.
Let me make sure of the default.plg file, if I want to include cpr installs for different resolutions, I just add all of them to that one file, correct? Just change the layout screenwidth,screenheight for each new cpr I need to write, for both portrait and landscape. So for vga only, I would have two layout sections, one with screenwidth=480, screenheight=640 and then another layout with screenwidth=640, screenheight=480? If a cpr doesn't exist on device, then it just skips that one and goes to next?
Just wanted to make sure I understood it correctly as I plan on updating titaniumweather this week and wanted to use this.
Yeah, that's pretty much it. All the different resolutions in one file. In your case you would just need two layout nodes for VGA, one for portrait and one for landscape.
showaco
28th April 2009, 07:27 PM
I'm working on getting next version of titaniumweather finished up and had a question/request. I noticed that your atplugin installer must be reading the defaultxml for plugin info before inserting and rewriting the default and extensibilityxml values. Is it possible to have it read the extensibilityxml for the info instead? A lot of people only update the extensibiliyxml when adding new panels since thats all that is necessary to show panels and with your current version all those panels are removed from extensibilityxml when atplugin installer runs. I can change it in chome editor to write to both locations, but still doesn't help out with someone that has made there own panels independently.
I've added option in weather to switch layouts using your atplugin app to change layouts for different style of weather icons, works very well to switch them out.
AppStar
28th April 2009, 09:24 PM
I just double checked and atplugininstaller reads from ExtensibilityXML first. It then injects the plugin name and updates ExtensibililtyXML and DefaultXML to the new value. I don't bother to read DefaultXML, I just override it since they both should be the same anyhow. I can change it to not override DefaultXML if users are having issues with it.
BTW, I'm glad to hear you got it working with additional layouts. I have the same feature in my latest Fave Contacts release. I was worried developers might have trouble because of case sensitivity. I use an XPath query and I'm not quite sure why the powers that be(W3C) decided XPath needs to be forced to case sensitive.
showaco
29th April 2009, 02:04 AM
I just double checked and atplugininstaller reads from ExtensibilityXML first. It then injects the plugin name and updates ExtensibililtyXML and DefaultXML to the new value. I don't bother to read DefaultXML, I just override it since they both should be the same anyhow. I can change it to not override DefaultXML if users are having issues with it.
BTW, I'm glad to hear you got it working with additional layouts. I have the same feature in my latest Fave Contacts release. I was worried developers might have trouble because of case sensitivity. I use an XPath query and I'm not quite sure why the powers that be(W3C) decided XPath needs to be forced to case sensitive.
huh, maybe just some weird issue I had going on then. After that first change up, everything after that didn't change my layout anymore. But I also updated chome editor to write to defaultxml too and reset my custom panels in after first change up, so maybe that fixed issue for me.:confused:
Yeah, got 4 or 5 different icon sets now, with different .plg files for each since most have different size icons and that was easiest way to have for future icon packs to be added without having to release new weather versions. Working on cab now, had trouble with install at first 'cause I was saving your ATPluginInstaller.exe to a subfolder under installation path, which is location I needed to work with my future addons. Got it sorted now(I think:)).
drkfngthdragnlrd
29th April 2009, 07:56 AM
Is there a way to specify the CPR's to modify in the .plg file? I have made completely new CPR's for NeoTitanium. Instead of being Titanium_(Resolution).cpr, they are Neo_(Resolution).cpr, M2DNeo_(Resolution).cpr, & BWNeo_(Resolution).cpr. for the different themes. I did this so the user can swtich back and forth from NeoTitanium to Titanium (or the different themes) without uninstalling it.
JukEboXAuDiO
29th April 2009, 04:30 PM
Thank you soooo much. I am going to try this out.
AppStar
29th April 2009, 05:30 PM
Is there a way to specify the CPR's to modify in the .plg file? I have made completely new CPR's for NeoTitanium. Instead of being Titanium_(Resolution).cpr, they are Neo_(Resolution).cpr, M2DNeo_(Resolution).cpr, & BWNeo_(Resolution).cpr. for the different themes. I did this so the user can swtich back and forth from NeoTitanium to Titanium (or the different themes) without uninstalling it.
Hmmm... I was going to pull the CPR file name out of the registry, but decided against it because I didn't have any way of knowing that the PLG file was indeed targeted to that CPR anyhow. Adding a node to the PLG is a good idea. But we need to be very careful with distribution. If users got a hold of your PLGs and tried to use them with a Titanium layout they would not work.
Mnemonique
29th April 2009, 06:21 PM
Nice!
Very cool indeed.
Just the thing I'm looking for :).
Was currently busy with pre-define cpr file to append at the titanium_(resolution_here).cpr, this surely helps a lot in making that happened.
Thanks!!!!!
JukEboXAuDiO
29th April 2009, 07:18 PM
I have a BIG question. In your ATFavePeople Cab you have a Setup.dll in the Main root of the cab but you don't talk about that. What is that Setup.dll for? I added the AtpluginInstaller, CESetupdll.dll, default.plg, and CHomeRefresh in the cab. Someone told the cab is unsuccessful when its installed and I can't quite figure out why.
AppStar
29th April 2009, 08:13 PM
I have a BIG question. In your ATFavePeople Cab you have a Setup.dll in the Main root of the cab but you don't talk about that. What is that Setup.dll for? I added the AtpluginInstaller, CESetupdll.dll, default.plg, and CHomeRefresh in the cab. Someone told the cab is unsuccessful when its installed and I can't quite figure out why.
I replied to your private message but i'll repost here incase others need the info.
Hmmm.. There are a couple things you need to check. Make sure the have the CESetupdll.dll configured properly in your INF file.
To include your CESetupDLL.dll in the INF file (file used to build installation CAB file) you have to add the following string to the [DefaultInstall] section:
CESetupDLL = "CESetupDLL.dll"
Also make sure your cab file is extracting all the files to the same folder.
AppStar
29th April 2009, 08:16 PM
Just a heads up... I'll be leaving for a business trip tomorrow and won't be back till Monday. I'll get to any questions and/or fixes when I get back. Thanks guys!
JukEboXAuDiO
29th April 2009, 10:49 PM
SO what do I do about creating a setup.dll file when I don't have a program that can create .dll files.
JukEboXAuDiO
29th April 2009, 10:57 PM
Can someone tell me where the [Default Install] section is in CE Cab Manager.
drkfngthdragnlrd
29th April 2009, 11:39 PM
Hmmm... I was going to pull the CPR file name out of the registry, but decided against it because I didn't have any way of knowing that the PLG file was indeed targeted to that CPR anyhow. Adding a node to the PLG is a good idea. But we need to be very careful with distribution. If users got a hold of your PLGs and tried to use them with a Titanium layout they would not work.
This is why I was wondering if there was a way to call out a specific cpr file name. That way if the cpr doesn't exist on the "machine", the plg does nothing. Also, in the future on release you'll see a lot more custom named cprs. HTC I know uses their own naming. My smart phone has like 5 different sets of cprs on it.
Genix9
3rd May 2009, 10:54 AM
Do you think there's a way to also include multiple plugins in the default.plg file?
I'm looking for a way to use the PluginInstaller to update existing .cpr default (Clock, Music, Photos, etc.) without messing up any additional/custom plugins people have put in.
sve1313
7th May 2009, 01:41 PM
Very nice. Thanks
twolf
8th May 2009, 02:00 PM
Finally was able to install a plugin made by this installer...
Almost all my *.cpr files were read-only, so the plugin wasnt able to save them and kept giving me the "AtpluginInstaller.exe" error.
Changed them to non read-only with Resco Explorer and all worked fine. :)
orlith
27th May 2009, 12:37 PM
Hi There.
don't know if I'm in the right topic if not I apologize.
I would like to know iif there is way to change the GUID of a "personnale" plugin. It seems that non standard plugin got the same guid, and on some case it makes trouble (I would like to put one of my personnal plugins by default when I press "hang" button).
Thanks
flaviopac
31st May 2009, 01:36 PM
Hi there!
Can anyone help me doing a cab file which should contains a plugin I developted?
I read this post:
http://forum.xda-developers.com/showthread.php?t=509492
But there are still some things I miss...
Thanks in advance for any help!
Cheers...
_______________
twolf
31st May 2009, 04:42 PM
Started a online flash tool to help skinners and developers to create the CPR/CPL file.
http://img198.imageshack.us/img198/6212/image1xen.jpg
Will do further developent during the week to create the full working CPL from scratch and even a .REG based on the editor settings. :)
Any feedback/ideas use this thread:
http://forum.xda-developers.com/showthread.php?t=520857
flaviopac
1st June 2009, 08:12 PM
My target is to build a cab of a Wm 6.5 plugin I develpted:
1) Using this tool: QuickCab 2.0; I built the cab, with all the reg keys, folders and stuffs I need.
2) in the cab I should insert "AppStar Titanium Plug-in Installer" too (the one I found here: http://forum.xda-developers.com/showthread.php?t=509492 )
3) The PLG file must be in the cab too, and I need to edit it as some examples suggest...
If I don't miss anything, it should work, RIGHT?
Thanks in advance for any help... :rolleyes:
rpereira
2nd June 2009, 04:21 AM
Finally was able to install a plugin made by this installer...
Almost all my *.cpr files were read-only, so the plugin wasnt able to save them and kept giving me the "AtpluginInstaller.exe" error.
Changed them to non read-only with Resco Explorer and all worked fine. :)
I have a permanent fix for this, let me know and i'll hook you up with a custom setup.dll that will launch a custom.exe, that will launch mortscripts that change the .cpr file attributes before launching ATPluginInstaller.exe . really works like a charm.
twolf
2nd June 2009, 10:30 AM
Appreciate it, but after I place them all as non read-only with Resco Explorer, they dont give me any more trouble. :)
blazingwolf
4th June 2009, 12:38 AM
Can I get a little help? I have made a version of the Opera favorites for WQVGA. I can get the code in the .cpr and it shows in the list of plugins in CHome Editor but there is no actual plugin on the screen. The registry settings work also.
Removed the cab so people don't download the broken one.
blazingwolf
4th June 2009, 01:46 PM
Wanted to say thanks to megapinky for showing me what was wrong with my Opera. Thank you. :)
twolf
5th June 2009, 09:06 PM
Im also with problems doing the cab, the installation works fine, but the plugin just doesnt appear (not related to the read-only issue)... :(
My plugin:
http://img189.imageshack.us/img189/7163/screen04q.png
http://forum.xda-developers.com/showpost.php?p=3904190&postcount=34
Any help would be very appreaciated, been cracking my head in this all day... :rolleyes:
flaviopac
12th June 2009, 02:50 PM
Can I get a little help? I have made a version of the Opera favorites for WQVGA. I can get the code in the .cpr and it shows in the list of plugins in CHome Editor but there is no actual plugin on the screen. The registry settings work also.
I have the same problem...
It seems the cab installation doesn't edit the default titanium plg to include the new plugin... :(:(
I think I miss something with CESetupDLL.dll...
Can someone provide some help? :(:o
MichelDiamond
29th September 2009, 09:32 AM
You can download the expanded ATPluginInstaller - which now has the name "TICS_installer" under http://forum.xda-developers.com/showthread.php?t=564884 (Beta2 works stable for the Themes / Plugins according to the Feedbacks I've got)
You have only to change from ATPluginInstaller.exe to TICS_installer.exe and use the there attached "setup.dll" instead of CESetupDLL.dll
The call of the Installer is no more in setup itself (because of the expansions impossible) - ut it's easy - only add two mortscripts "install.mscr" and "uninstall.mscr" to your Main Plugin Directory - where you now can call, what you want - will be called by the new setup.dll while installing/uninstalling cab.
It's easy to change - but then each .plg can be installed in each .cpr / Theme - and a lot of more options, too.
Thanx 2 Appstar for this concept!
Micha
helix111
9th July 2010, 05:30 PM
I have an interesting problem.
I installed chome editor v1.6 on my wm6.5 device.
At first it was working fine, and I created 2 plugins using it.
THEN, I decided to add the "day of the week" to the clock panel, by placing code directly in the titanium.cpr files.
Well, the weekday was added successfully, BUT now, I CAN'T use chome editor to create new panels, and I CAN'T install any plugin that uses the ATinstaller.
Whenever I try to do either, I get:
"An unexpected error occurred in ATplugininstaller
ATplugininstaller.exe unauthorized access exception
At System.IO._Error.WinIO error()
At System.IO.FileStream..ctor
At System.IO.FileStream..ctor
At System.Xml.XmlTextWriter..ctor
At System.Xml.XmlDOMTextWriter..ctor
At System.Xml.Xmldocument.save
At ATPlugininstaller.Main.AddLayout to cpr()
At ATPlugininstaller.Main.Main ()
As I said, I get this same message when I try to create a new panel or add any cabs that require the plugin.
However, the panels I already created and the plugins I already installed still work fine.
My question is, why? My manually adding the code into the cpr files to show "day of the week" on the cclock panel is no different than the entries the installer makes when I install a plugin, or create one using Chome editor.
I know, I've looked thru the cpr file content. So, why does the installer crash AFTER I add the code for "day of the week" to the cpr files?
Can someone please help? Thanks.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.