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

how to convert bool to string in installscript?


2 replies to this topic

fegorsch

fegorsch
  • Full Members
  • 11 posts

Posted 15 October 2010 - 09:41

hi,

I want to let the user chose which shortcuts should be created. So I'm using an AskOptions dialog that stores the users choice in a boolean. Now I want to set the e.g. CREATE_DESKTOP_SHORTCUT property to the value of the corresponding variable, using MsiSetProperty, accepting an msi handle, the property name (string) and the property set value (string) as arguments.
Unfortunately I can't find any information on how to cast (or convert) a boolean to a string in installscript. Does anyone have ideas on how this (seemingly easy) task could be accomplished, or alternative solutions?

Regards, Felix

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 October 2010 - 16:35

CODE
if ( bCreateDesktopShortcut = TRUE ) then
 MsiSetProperty(hMSI, "CREATE_DESKTOP_SHORTCUT", "1");
endif;
// no else needed: if the property isn't set it's equvalent to FALSE


fegorsch

fegorsch
  • Full Members
  • 11 posts

Posted 21 October 2010 - 14:38

thanks a lot, as usual i wonder why i didn't do it that way from the start.

if anyone is lead to this topic still looking for a way to convert strings to integer or the other way round, there are actually NumToStr and StrToNum functions.