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

Sprintf problem


5 replies to this topic

Arnaud

Arnaud
  • Members
  • 28 posts

Posted 26 September 2001 - 15:49

i'm using ISWI 2.03.....
all work fine, but 2 weeks ago, sprintf stop to work, i mean, that when you call sprintf function the installation crash.

I know there es some problem with this options .....
have somebody heard about this problem ?

or is there a possible replacement function ???

Ex of the code:
Sprintf(ligne, 'GENSTRUCT=%s\src_base\\copie_table\\NT4_Intel\\genstruct.exe toto', TARGETDIR);

i put the string into ligne.
STRINGligne[500].
i have tested  it with  STRINGligne
THe problem is the same ....

I have to repeat that the script have been working for a while, and then it don't


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 September 2001 - 20:53

Shouldn't that be a double backslash:
'GENSTRUCT=%s\\src_base\\copie_table\\NT4_Intel\\genstruct.exe toto'

Arnaud

Arnaud
  • Members
  • 28 posts

Posted 27 September 2001 - 08:11

Thx for the answer , but no, it 's not a problem since I'm putting TARGETDIR into the %s.
so the backslash is not added if not required...

I've got to say that this solution works fine for a while, and then (suddenly i can say :)) ) it doesn't work anymore .....

(I 've already tried to put a "\\" put it produce a double backslash ...)

thx again for the answer


pdriley

pdriley
  • Members
  • 91 posts

Posted 27 September 2001 - 19:24

But isn't that because you already have a backslash in TARGETDIR, thus
'GENSTRUCT=%s\\src_base
Translates the %s as x:\xxxxx\
and the rest as \src_base

Only putting one backslash in will translate %s and then add an escape sequence "\s" plus "rc_base".

If TARGETDIR includes a backslash then you don't want any directly after the %s.

Alternatively, you could just forget Sprintf and use
GENSTRUCT = TARGET_DIR ^ "src_base"
which is the standard way in InstallScript of linking two parts of a path without knowing whether the backslash is there already or not.


Arnaud

Arnaud
  • Members
  • 28 posts

Posted 28 September 2001 - 07:05

Yes, i agree with you....
The thing i want to underline once again, is that this whole thing work perfectly for a while !!!!

I have tried your method, as i try a
ligne = "GENSTRUCT=" + "TARGETDIR" + .....

the concatenation way, in fact.

All these things work, but why does it stop to work with the sprintf ...??
I think that we certainly never know... :))

Ok thanks you for yours answers , all of you.