tatsudoshi
27th August 2003 08:57 UTC
Remane aka Win32 API MoveFile
This is my test script:
OutFile "C:\Documents and Settings\Administrator\Desktop\test\RenameTest.exe"
InstallDir "C:\Documents and Settings\Administrator\Desktop\test"
Section "Rename Test"
Rename "$INSTDIR\source" "$INSTDIR\dest"
SectionEnd
I have in the folder "test" 2 other folders "dest" and "source". In the "source" folder I have a txt file "testfile.txt". What I would like to get at here is to get the installer to move the contence of folder "source" to folder "dest".
From the docu:
Rename source_file to dest_file. Functions just like the Win32 API MoveFile, which means you can move a file from anywhere on the system to anywhere else, and you can [B]move a directory8/B] to somewhere else on the same drive
But I just can't get it to move the damn Dir from point A to B. Any and all help is appriciated :)
Joost Verburg
27th August 2003 11:31 UTC
Did you try to call MoveFile? Maybe it doesn't move content when the directory already exists.
tatsudoshi
27th August 2003 11:42 UTC
What do you mean with "call MoveFile"?
Joost Verburg
27th August 2003 13:12 UTC
The MoveFile Win32 API (http://msdn.microsoft.com/library/de...e/movefile.asp).
Probably it doesn't move content when the directory already exists. You can use CopyFiles to copy the content and then delete the old folder.
tatsudoshi
27th August 2003 13:42 UTC
Hmm, I see your point, but the MSDN says
MoveFile
The MoveFile function moves an existing file or a directory, including its children.
To specify how to move the file, use the MoveFileEx function.
With "Children" I think it also means Dir's which holds files and subDir's, don't you? Maybe it's a bug in NSIS?
Joost Verburg
27th August 2003 15:33 UTC
It's doesn't say that it moves the content when the destination directory already exists, only that it can move a directory.
tatsudoshi
27th August 2003 17:08 UTC
True.. I guess I have to use CopyFiles and RMDir.
Btw: Do you know how I can make the installer check if there is a previus install and if, then ask if the user want to uninstall it or quit?
Joost Verburg
27th August 2003 18:11 UTC
You have to check for registry keys or files. You can use messageboxes or custom pages to get input from the user.
tatsudoshi
27th August 2003 19:01 UTC
oki thx m8..