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

Path in custom action


3 replies to this topic

frtr

frtr
  • Members
  • 10 posts

Posted 26 August 2004 - 20:59

Hi!

I have some difficulties with passing a path as a custom action parameter.

In my custom action, i pass a path like this :

/myPath="[PATHPROPERTY]\"

If the path entered by the user is let's say

C:\Programs Files\ProgramX

There is no problem.

However if the user enter :

C:\Programs Files\ProgramX\ ( notice the trailing backslash ) it will crash.

Any idea why I have this problem?

The ideal solution would accept :

C:\Programs Files\ProgramX
and
C:\Programs Files\ProgramX\ as a valid path.

I can also clean the path string in my custom action afterwards, but I only need the data to be passed to my custom action.

I thank you very much in advance.

Note : I use Visual Studio .net without any authorware

Francois Tremblay ph34r.gif

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 27 August 2004 - 08:23

I think windows installer treats all paths as having a trailing backslash. Try to pass [PATHPROPERTY] and see if that resolves the problem.
Regards
-Stein Åsmul

frtr

frtr
  • Members
  • 10 posts

Posted 27 August 2004 - 13:48

I found the problem... so I post it here for you all!

The edit text box controls are of type edit. We must replace it in orca with PathEdit (not sure of the upper/lower cases). This way, the trailing backslash is always added at the end of the path if it's not there and now everything works fine.

To automate the problem, just create a project with a dependency on your deployment project and use SQL queries to change the MSI directly!

Now works greats! Thx!

Francois Tremblay

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 27 August 2004 - 15:21

Great that it works. If your setup is run in silent mode and the directory is specified as a public property on the command line it is feasible that the path could have no trailing backslash.
Regards
-Stein Åsmul