net Setup Project >> Custom Actions >> [TARGETDIR], error when user inputs path with spaces
Posted on 2006-04-05
I have created a Setup Project in .Net studio 2005, an install class that is included in the setup project and launched as a custom action on install and commit phases.
This install class requires path of the installation for some of its functions - which i attempted to pass to it by adding following line
to the CustomActionData property of the custom action.
During installation if the path the user selects contains no spaces, install goes through fine. If it does install throws System.IO.FileNotFoundException (this is being thrown by installer, not my class because the error happens even with an empty Installer class)
Attempted install path: c:\Program Files\MyCompany\MyProgram
Exception occured while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly
file:///C:\WINDOWS\System32\Files\MyCompany\MyProgram\ or one of its dependancies. The system could not find file specified.
No error if path is given as c:\ProgramFiles\MyCompany\MyProgram
I have found my way arround the error by writing [TARGETDIR] to registry and then retrieving it from there in my install class. But it seems strange for windows installer to crash when it encounters file system path with spaces.
So I want to know if i did something wrong to stumble on this error, since from other posts i read about setup projects other people seem to be having no such problems with the TARGETDIR property