Jump to content

OpenG Package Builder Help


jgcode

Recommended Posts

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

  • Like 1
Link to comment

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)?

Link to comment

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.

  • Like 1
Link to comment

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 by jgcode
Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

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 by jgcode
Link to comment
  • 3 months later...

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.

  1. We can't add a VI to a package using the PostBuild Hook in VIPM. It throws an error, as mentioned on JKIs pages.
  2. 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.
  3. Modifying manually the spec file works... if you rename the file as .ogp. VIPM recognizes the package, installs it and launches the PostInstall vi.
  4. 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:

post-10515-126229637855_thumb.png

* Credits to VIE: this is freely inspired from a VI that CRelf posted a while back.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.