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?
Renaming a directory
Renaming a directory
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
-
- 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~
This renames c:\\temp to c:\\temp2.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Michael,
thank you.
thank you.
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
This one drives me crazy. Running in the debugger is ok. Running standalone I get an
"unable to load plug-in library. Please rebuild project...".
A few lines above I already use the "call DLL plug-in."
What I'm doing wrong?
"unable to load plug-in library. Please rebuild project...".
A few lines above I already use the "call DLL plug-in."
What I'm doing wrong?
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
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~
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Were you using the same GUID in both commands?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
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.
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
-
- 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
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Actually, I was wrong - the IDE is already checking for that, apparently. I really don't know why that's happened on your end, sorry.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 76
- Joined: Wed Sep 12, 2007 3:34 pm
-
- Posts: 76
- Joined: Wed Sep 12, 2007 3:34 pm
Who is online
Users browsing this forum: No registered users and 96 guests