View Full Version : RenameFile fails

01-26-2015, 08:52 AM
Hi everyone,

The following is going on:
I have made custom action which runs a Installscript function to renamefile. I have used the renamefile example given in the help to change the file name.
The directory in which the file can be found is in the in [CommanAppDataFolder].

I have selected a DoAction if the finish button is pressed in the SetupComplete Dialogue. I get the notification the rename has failed, although the directory and the file that needs be changed are available.

If I have the folder and file to be changed already available before the setup is run, all things go well.

Does anybody know how I can succeed in changing the filename without having the original file on the target system?

Thanks in advance and regards,


01-26-2015, 09:29 AM
It sounds like you might be trying to make a change that requires elevated privileges. Typically actions launched from the wizard do not have such privileges, and instead such changes need to be scheduled as deferred system-context actions in the Install Execute sequence.

01-26-2015, 11:23 AM
Hi Michael,

I have changed the "In-Script Execution" to Deferred Execution in System Context. The "Return Processing" is Synchronous (Check exit code).
I have placed it in the "Install Exec Sequence" After PublishProduct and set the condition to the name of the radiobutton that has to be selected.

Unfortunately this leads also to a failure. Can you be more specific regarding your solution or explain to me what's wrong with the settings mentioned above.

Regards, Reza

01-27-2015, 09:33 AM
It sounds like you've correctly applied the changes I was pointing to. So there must be another problem. Can you find out what's failing? For instance, watch it with process monitor to see what goes wrong. Or display the file name are you moving from and to, and check if the file is present while the message box is up.