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

Case sensitive path problem


5 replies to this topic

gronchi

gronchi
  • Members
  • 71 posts

Posted 06 March 2003 - 15:38

Hi to all,
the problem.

Suppose you have a setup asks the user to insert a destination path (with default). For example the default is:
C:\COMPANY_NAME

Suppose the user had already that path onto his pc only differing in capital letters. For example:
C:\company_name

Suppose the user leave the default when he meet the SdAskDestPath dialog.
szDir = "C:\\COMPANY_NAME";
nResult = SdAskDestPath(szTitle, szMsg, szDir, 0);
Now szDir is "C:\\COMPANY_NAME" (unchanged)

Suppose I write szDir into registry for future purpose

Suppose another application read szdir from the registry

Suppose (another one? Yea the last but not the least!!!;) this application work with case sensitive logic, it looks for something in "C:\COMPANY_NAME" while the desire's object it's in "C:\company_name"

What could you do?
Please note you can't modify the "case sensitive" application, you can just work onto the istallation issue


Thanks to all,
ciao Giuseppe

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 06 March 2003 - 16:18

Way to many supposes. :p

I'm sorry,but directories & filenames should never be case sensitive, so that other application is just plain wrong!!!
user posted image

gronchi

gronchi
  • Members
  • 71 posts

Posted 07 March 2003 - 08:18

Maybe there is some windows api that retrieve the case sensitive directory name?
Otherwise I have to:

1. acquire the user destination path (from dialog) into szDir

2. split them into each directory level:
C
dir_level_1
...
company_name

3. goto root dir (C:\;)

4. if existdir "dir_level_1" (into file system) get "dir_level_1" (from file system) into a support string variable. Is there some built in function do that?

5. now into support string variable I have the "exact case" dir_level_1, I substitute it into szDir

6. repeat fot each level dir

a bit complex... but I have no other idea!
Thanks to all,
ciao Giuseppe

runningquicklynowher

runningquicklynowher
  • Members
  • 20 posts

Posted 13 March 2003 - 20:28

Gronchi,
Just use the StrToLower and StrToUpper functions (function details are in the IS help index).  If you need the path in the registry to be upper case in order for your other app to read it properly, simply call the StrToUpper function before you write the path the user has entered to the registry.   The functions will convert full file paths so you won't need to parse out each section individually unless you need part of it upper and part of it lower (ie C:\test\COMPANY_NAME)

For example, the StrToUpper function will convert your string "C:\company_name" to "C:\COMPANY_NAME" and it would convert "C:\test\company_name" to "C:\TEST\COMPANY_NAME"

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 14 March 2003 - 16:58

I don't think switching the case will solve his problem since this third party setup needs the case sensitive path, but nice try. ???
user posted image

runningquicklynowher

runningquicklynowher
  • Members
  • 20 posts

Posted 14 March 2003 - 18:43

It was worth a shot.  Sucks that a third party program is playing games with case sensitivity like that.  Maybe there is some sort of ascii check he could do?