Archive: (Newbie) Rename problem


(Newbie) Rename problem
Hi,

In my script, I have the following lines:

StrCpy "$APACHECONFDIR" "C:\Program Files\Apache Group\Apache\conf\"

and later...

Rename "$APACHECONFDIR\http.conf" "$APACHECONFDIR\Xhttp.conf"

It never works. I have no clue as to why.

NSIS version 2.0 release candidate 2
Building on XP, running the installer on ME.
Apache is not and has not been running.

This is but one example - I have yet to construct a rename command that worked.

I've also used something like:

SetOutPath "$APACHECONFDIR"
Rename "http.conf" "Xhttp.conf"

Didn't work either. Clues please?

Thanks!
Stan


Before:


StrCpy "$APACHECONFDIR" "C:\Program Files\Apache Group\Apache\conf\"

Did you use:

Var "APACHECONFDIR"

Hi Lobo Lunar,

Yes, I did use Var, and I confirmed with a message box that the path is getting set as I expect.

Would the use of the trailing slash on the path affect the rename?

Stan


Then:


StrCpy "$APACHECONFDIR" "C:\Program Files\Apache Group\Apache\conf\"
Rename "$APACHECONFDIR\http.conf" "$APACHECONFDIR\Xhttp.conf"

with

StrCpy "$APACHECONFDIR" "C:\Program Files\Apache Group\Apache\conf"
Rename "$APACHECONFDIR\http.conf" "$APACHECONFDIR\Xhttp.conf"

That back-slash

That doesn't seem to help.

In case it isn't obvious, all I'm trying to do is back up the current version of httpd.conf, by renaming it to Xhttpd.conf. Then I just use the File command to extract the new conf file I want to use. I always get the new conf file (File command works fine), but have yet to see a renamed file.

I'm filing the serial numbers off of my script so I can post the whole thing here for review. 'Til then, any more ideas?

Thanks,
Stan


Ok, here's the whole script with all the other stuff I was trying to do removed.

; preamble
Name "none"
OutFile "NoInstaller.exe"

; Adds an XP manifest to the installer
XPStyle on

; install directory options
InstallDir "C:\"
AllowRootDirInstall true
ShowInstDetails show
ShowUninstDetails show
SetCompress auto

Var APACHECONFDIR

Page instfiles

; main section
Section "v3"
SectionIn 1 RO ; this section is always included

StrCpy "$APACHECONFDIR" "C:\Program Files\Apache Group\Apache\conf"

Rename "$APACHECONFDIR\http.conf" "$APACHECONFDIR\Xhttp.conf"

SetOutPath "$APACHECONFDIR"
File "httpd.conf"

SectionEnd

;eof


DOH!

Misnamed file. Saw it the instant I posted the previous message.

Sorry to bother everyone. I'll go find some other stupid mistake to make now (and don't think I won't either :) )

Stan