Hi,
Anyone knows how to check for invalid characters in installation path?
angp
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.
How to check for invalid characters in path
Started by
angp
, Jan 12 2006 05:47
2 replies to this topic
Posted 12 January 2006 - 05:47
I mean from custom action, using C++ code, how to validate that the installation path specified by user do not contain invalid characters.
Edited by angp, 12 January 2006 - 05:48.
Posted 12 January 2006 - 09:27
If you want to validate a supplied folder:
The best way is using the control event (not custom action!) SetTargetPath, when the supplied path does not qualify, a suitable message is shown and all remaining control events are skipped.
SetTargetPath checks for many properties, eg. not existing drives, valid characters, read-only folders, volumes without support for long file names, etc.
If you're just after a name to be used for a file:
In the temp folder, create a unique folder, in that folder try creating a file with the supplied name.
The best way is using the control event (not custom action!) SetTargetPath, when the supplied path does not qualify, a suitable message is shown and all remaining control events are skipped.
SetTargetPath checks for many properties, eg. not existing drives, valid characters, read-only folders, volumes without support for long file names, etc.
If you're just after a name to be used for a file:
In the temp folder, create a unique folder, in that folder try creating a file with the supplied name.