Archive: Permission problem on Windows 2008 Server


Permission problem on Windows 2008 Server
Hi, does anyone have some experience on permission/installing on Windows 2008 Server? I have a command which is setting Default Document in IIS7, which is using appcmd.exe. When I ran the command in a Command Line Window everything worked, but running that command in NSIS nothing is happening. Does anyone know why it is like that? I think I have a permission problem, but I got no error messages.

I have shipped with an example script.

Best Regards, Frode

******** Script ********

Name "AppCmdTest"
OutFile "AppCmdTest.exe"
ShowInstDetails show
Page components
Page instfiles

Section "Set Default Document"

Push $0

; Add index.php as Default Document
ExecWait '%windir%\system32\inetsrv\appcmd.exe set config /section:defaultDocument /enabled:true /+files.[value=$\'index.php$\']' $0
DetailPrint "ExecWait returned: $0"

Pop $0

SectionEnd


Workaround
If i put my commands in a .bat file, and then run that file with ExecWait everything worked perfectly. But it should be interesting to know why ExecWait is not working with given command.


Problem solved.

It was not a permission problem. The command was not executed because it was an error in path. I had to use SetOutPath, and not use full path to appcmd.

This worked:

SetOutPath "C:\WINDOWS\system32\inetsrv"
ExecWait 'appcmd.exe set config /section:defaultDocument /enabled:true /+files.[value=$'index.php$']'