Renaming a directory
Renaming a directory
Hi Michael,
I need to rename a directory before the windows installer uninstalls a previous version.
All I found was Copy/Move Local Files - but this is based on MSI.
Is there an easy way to accomplish this?
I need to rename a directory before the windows installer uninstalls a previous version.
All I found was Copy/Move Local Files - but this is based on MSI.
Is there an easy way to accomplish this?
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
There's a very easy way. Use the MoveFile API with Call DLL Function. No need to author a custom DLL or plug-in for this!
This renames c:\\temp to c:\\temp2.
Code: Select all
~InstallAware Clipboard Data~
~Call DLL Function~
~{377AD747-17BC-42DE-9AE6-EB7B8A175777}~
~kernel32.dll,MoveFileA,bool,,"pointer to string",c:\\temp,"pointer to string",c:\\temp2,$~
~mIDEFunc.dll\\mEXEFunc.dll~
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
After hours of try and error I finally deleted the command and reentered it again manually. And now it works!
The difference is - the GUID!
The difference is - the GUID!
Code: Select all
~InstallAware Clipboard Data~
~Call DLL Function~
~{974D685E-3C60-4F2A-892E-3035C85DC000}~
~kernel32.dll,MoveFileA,bool,RENAME,"pointer to string",$OLDDBDIR$,"pointer to string",$OLDDBDIR$.1,$~
~mIDEFunc.dll\\mEXEFunc.dll~-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
No,
I simply cut'n pasted your sample into my script. Then I changed the two directory names.
It was running in the debugger but always failed at runtime.
Then after hours I gave up and deleted the command and reentered it manually again.
It is exactly the same as before but now it's working.
Finally I copied my command to the clipboard and compared my working version with yours.
And the only difference is the GUID.
I don't understand what is wrong here. But I remember that I had a similar problem some days ago.
A copied If command behaved exactly the other way around. I also deleted this and entered it again and it was working.
I simply cut'n pasted your sample into my script. Then I changed the two directory names.
It was running in the debugger but always failed at runtime.
Then after hours I gave up and deleted the command and reentered it manually again.
It is exactly the same as before but now it's working.
Finally I copied my command to the clipboard and compared my working version with yours.
And the only difference is the GUID.
I don't understand what is wrong here. But I remember that I had a similar problem some days ago.
A copied If command behaved exactly the other way around. I also deleted this and entered it again and it was working.
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Oh, I think the problem is because you pasted the same copied text twice - so both pastes ended up with the same GUID.
I'll be sure to file this as an issue - GUIDs have to be monitored on paste to make sure there aren't any duplicates.
I'll be sure to file this as an issue - GUIDs have to be monitored on paste to make sure there aren't any duplicates.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
-
sdeschenes
- Posts: 76
- Joined: Wed Sep 12, 2007 3:34 pm
-
sdeschenes
- Posts: 76
- Joined: Wed Sep 12, 2007 3:34 pm

