Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

'ISMSI_HANDLE' and include "iswi.h"


9 replies to this topic

halciber

halciber
  • Full Members
  • 25 posts

Posted 06 March 2006 - 22:41

Hi Everyone,

I need to use ISMSI_HANDLE for some MSI functions. I've included #include "isrt.h" in the script. However, I'm getting an error:

'ISMSI_HANDLE' unidentified identifier

In addition to this, I'm an getting error including "iswi.h" in my script. The error is:
"Can't open include file."

Does anyone know what project settings I need to get these items recognized in my script?

Thanks again,
Mike

P.s. Can you believe all I tried to do this morning was use MSISetProperty?

antyagi

antyagi
  • Full Members
  • 121 posts

Posted 07 March 2006 - 05:57

Documentation says:
ISMSI_HANDLE is not supported in Basic MSI projects, and is not supported in InstallScript custom actions.

If you want ot use MSI Handle in InstallScript function you probably should use this.
CODE
export prototype myFunction ( HWND );

function myFunction ( hMSI )
begin
   MSISetProperty ( hMSI, "MY_PROPERTY", "MY_PROPERTY_VALUE" );
end;


  ankur tyagi

halciber

halciber
  • Full Members
  • 25 posts

Posted 07 March 2006 - 17:01

Hi antyagi,

Thanks for getting back to me.

I did see that same warning in the documentation; however it doesn't apply to me because I'm not doing an MSI project or a custom action. I'm simply trying to call this function from the install script.

I've seen in the documentation install script examples where they included iswi.h and used ISMSI_HANDLE.

I don't understand what my project is missing from that is preventing me from using these items.

As far as a custom action goes, I think this would be over kill for 3 lines of code.

Do you have any other ideas?

Thanks again,
Mike



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 March 2006 - 19:23

ISMSI_HANDLE is the handle of the currently running .msi database. Which mean that it's only valid in MSI projects, not in pure InstallScript projects. If you don't use MSI in your project there's no MSI handle and no use in calling MSI functions that require the handle of a running msi database.

halciber

halciber
  • Full Members
  • 25 posts

Posted 07 March 2006 - 19:55

Oh, ok. Thanks for clarifying that. I didn't realize I was mixing systems.

That being the case, how do I change the ProductVersion property in my installscript code?

Thanks for your help. I appreciate it.

Sincerely,
Mike

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 March 2006 - 18:28

I don't think there is such a property in a pure InstallScript (non-MSI) project. Do you see any reference to a ProductVersion property in your project?

halciber

halciber
  • Full Members
  • 25 posts

Posted 08 March 2006 - 20:09

I don't see it in the code, however if you look at the IDE under Description->General Information->Project Properties you have a place to manually put in the Version number.

I've been looking for a way to change this number in the installscript code to get it to work with our company's build script. I need to get my installation's 'productversion' to match what is generated during our daily build.

I thought I found this solution the other day when I discovered the MsiSetProperties method. That's what began my posts for the last 2 days.

Thanks to you I know that I can't use the Msi methods in an pure InstallScript project; however I was hoping there is another way to change this value in the script.

Thanks for your help,
Mike



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 March 2006 - 10:12

I think you can set this number at runtime:
IFX_PRODUCT_VERSION = szYourVersion;

But you may also be able to set it at build time, using InstallShield's automation interface.

halciber

halciber
  • Full Members
  • 25 posts

Posted 09 March 2006 - 17:46

Ok, Thanks! I'll give those a try. I really appreciate your help and this web site.

Sincerely,
Mike Goldweber

halciber

halciber
  • Full Members
  • 25 posts

Posted 09 March 2006 - 18:07

Dear Stefan,

I just tried your suggestion (using "IFX_PRODUCT_VERSION = szYourVersion"). It worked perfectly. After all the time I spent this week on this problem, I can't believe how simple it was.

Thanks again for your help. I'll be looking into the automation a little bit more, because that looks exciting too.

Sincerely,
Mike Goldweber