jgcode Posted September 10, 2009 Report Share Posted September 10, 2009 Would anyone be kind enough to post any links to documentation etc.. about the OpenG Package Builder. I am particularily interested in Script VIs (or hooks) and if there is a template available and if there is/what information is passed to the template. Regards JG Quote Link to comment
Ton Plomp Posted September 10, 2009 Report Share Posted September 10, 2009 I checked the source code of the OGPB and the pre and post-build VIs don't get any parameters. I think it is quite save to say that nothing is sent in the other VIs. Checking the pre- and post - install VIs should be done with the source code of OpenG commander. However I think that VIPM tries to read the 'error in' and 'error out' controls if they are available. Ton 1 Quote Link to comment
jgcode Posted September 10, 2009 Author Report Share Posted September 10, 2009 Thanks Ton Are you able to eloborate on this? Checking the pre- and post - install VIs should be done with the source code of OpenG commander. However I think that VIPM tries to read the 'error in' and 'error out' controls if they are available. Post Install Script info is what I am chasing. Have you done one before? Is there any way to access to the package file path (or is this done relative to the Script VI)? Quote Link to comment
hooovahh Posted September 10, 2009 Report Share Posted September 10, 2009 Here's some info on the post build hook. http://forums.jkisoft.com/index.php?showtopic=839 I don't know if there is similar hooks for post install. I didn't know that VIPM supported post install hooks, are you sure you mean post install? Remember that the post build VI does not get brought to the front, or focused when it is ran, so if there is some user interaction you'll need to use a Windows DLL to bring it into focus. 1 Quote Link to comment
jgcode Posted September 10, 2009 Author Report Share Posted September 10, 2009 (edited) Here's some info on the post build hook. http://forums.jkisoft.com/index.php?showtopic=839 I don't know if there is similar hooks for post install. I didn't know that VIPM supported post install hooks, are you sure you mean post install? Remember that the post build VI does not get brought to the front, or focused when it is ran, so if there is some user interaction you'll need to use a Windows DLL to bring it into focus. Hi Hooovah, thanks for the VIPM link. I use these VIs and have them as templates in my library. But yes, I am chasing information on Post Install Hooks. The reason is I am trying to install files in a path that must be resolved at the time of installation. If the path is resolved at the time of the build then the path is set to the computer that builds the package. And this is a problem. I want to package up the files but then get access to them and install them myself in the resolved location. Given that is what I am trying to do, is there a better way, or is Post Install Scripts the way to go? Alternatively I am thinking a Pre Install script may work, where I can edit the .OPGB file with the resolved path. But I was hoping for a lead into any data that is passed between the Installer (VIPM) and the Hook VIs. As they are included in OGPB I assume VIPM supports them. Maybe it is a good idea that I post there and ask! Cheers JG Edited September 10, 2009 by jgcode Quote Link to comment
hooovahh Posted September 10, 2009 Report Share Posted September 10, 2009 Yeah I wish VIPM supported making packages with post install, and post uninstall hooks but it doesn't. If you want to manually make your own package that performs these operations I'd say look at the oglib_lvzip to get an idea on how to do it. Rename the .ogp package to .zip, uncompress it, and take a look at the text file in the root to get an idea on how to perform a post install, or post uninstall. Assuming you've already done that and have a post install VI that works, I don't know how you could get information like the directory that the package exists in. Once you get that VI running if nothing else you could ask the user to browse to the package. Quote Link to comment
Ton Plomp Posted September 10, 2009 Report Share Posted September 10, 2009 A twist might be the following scenario: Using OGPB, use a pre-build VI, this pre-build VI will alter some values in a pre-install VI (the installation directory for instance), and will save these values as the default. This Pre-build VI is not included in the OGP file. VIPM definitely supports pre/post install VIs. Ton Quote Link to comment
jgcode Posted September 11, 2009 Author Report Share Posted September 11, 2009 I can't edit my original post but there is now a [cross post to JKI] Quote Link to comment
Daklu Posted September 11, 2009 Report Share Posted September 11, 2009 I've looked for installation path information to use in my post-install/pre-uninstall scripts too, with pretty much the same result. I did find one avenue that showed some potential, but time constraints have prevented me from investigating it deeply. When VIPM installs/uninstalls a package it saves the package configuration file in the temp directory. It should be possible to read the configuration file from the temp directory and extract whatever information you need. Let me know what you find out. Quote Link to comment
jgcode Posted September 12, 2009 Author Report Share Posted September 12, 2009 (edited) When VIPM installs/uninstalls a package it saves the package configuration file in the temp directory. It should be possible to read the configuration file from the temp directory and extract whatever information you need. Let me know what you find out. Ok, I played around with this for a while now and here is the low down: After searching around I have been unable to find the .spec file for the currently installed packaged in a temp directory. (Which temp directory is it? C:\Users\<me>\AppData\Local\Temp???) The other location I may have been able to use is the cache. But I thought about this I can't be 100% sure where the cache folder is: Is it C:\Program Files\JKI\VI Package Manager\cache or C:\Users\<me>\AppData\Local\VirtualStore\Program Files\JKI\VI Package Manager\cache?? (PC dependent) Therefore I decided to store all files I need to manipulate in the package to a known location. I choose C:\Users\<me>\AppData\Local\Temp\OGPB\... Now I know exactly where they are. The path is set in the spec, and I just have to create it in my scripts. Easy. I handle all the installation and uninstallation of files with scripts. Heck, I even wrote a small API that I can reuse for this stuff that creates a file with all the installed file paths so I can clean them up nicely at uninstall. I little bit more work for this edge case, but now I have my package for icons and I am very happy fo' shizzle I've looked for installation path information to use in my post-install/pre-uninstall scripts too, with pretty much the same result. I did find one avenue that showed some potential, but time constraints have prevented me from investigating it deeply. Yep, it sure would be handy if the same info was available that is in the VIPM build hooks. Edited September 12, 2009 by jgcode Quote Link to comment
Francois Normandin Posted December 31, 2009 Report Share Posted December 31, 2009 I don't know if this is gonna help... after a few hours of playing around with PostInstall VI, I finally got something working for me. We can't add a VI to a package using the PostBuild Hook in VIPM. It throws an error, as mentioned on JKIs pages. I compared the spec file structure of an OGP file with PostInstall.vi and a VIP file without. It seems the difference is simply in the "Package" section which contains ID, File Format and File Version. And the section name is different ("Package Name" instead of "Package"), plus the PostInstall.vi itself. Modifying manually the spec file works... if you rename the file as .ogp. VIPM recognizes the package, installs it and launches the PostInstall vi. Don't modify the VIP file directly with the Post Build Hook VI, instead copy it to a separate ogp file and modify it, otherwise you'll get an error and the package version number won't increment in VIPM package builder... Changes I made to the spec file in the package: * Credits to VIE: this is freely inspired from a VI that CRelf posted a while back. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.