Skip to content
⌘ NSIS Forum Archive

CreateDirectory not working

9 posts

ehsansad#

CreateDirectory not working

This code dose not make the directory?

CreateDirectory $ProductDirState/EDMproducts/EDMserver/EDMdbServer/database/$mySlotName
Can someone tell me why?
ehsansad#
this is the second attempt the first one was like this
CreateDirectory $ProductDirState\EDMproducts\EDMserver\EDMdbServer\database\$mySlotName
I think it has to do with the parameters, maybe it can not understand them at runtime?
demiller9#
It can understand variables like those. What values have you put in them? The $ProductDirState should begin with a local drive (like C:\). Does your installer run with enough rights (Admin) for the location you want to create the directory in?
Anders#
Use MessageBox to verify that the path looks correct, if it still fails; try running Process Monitor
ehsansad#
I'm testing it on my developer PC which I run as admin. The $ProductDirState is basically something like C:\some_folder or some other directory.
BreezeUADN#
You better check it with messageBox because it can be ${ProductDirState} for example, or it may be in a section/function that never runs because of some failed condition
ehsansad#
Fixed, thanks a lot. It was a combination of bad checking and the slash!, this one I don't understand, shouldn't CreateDirectory() work with both '/' and '\' ?
Afrow UK#
Why? We're on Windows not Unix. Using / instead of \ is really a code error and ought not to work.

Stu