0

In my OnFirstUIAfter function, I rename a file that was just installed, using:

RenameFile(FileName1, FileName2);

In my OnMaintUIAfter function, I install FileName1 again, but it needs to over-write FileName2, just as it did in the initial install. If I simply use:

RenameFile(FileName1, FileName2);

Nothing happens. I still have both files in the INSTALLDIR, and FileName2 is out of date.

Believing that there's a problem with the installer script not being able to rename an existing file, I have since determined to delete the file prior to the rename.

DeleteFile(FileName2);
RenameFile(FileName1, FileName2);

And still nothing happens. Both files are still in the INSTALLDIR.

Keep in mind that FileName2 is not a file being installed by any previous install. All the installs install FileName1 and then rename it to FileName2.

Any words of wisdom? I'm completely out of ideas.

SH

4

1 回答 1

2

我最好的智慧之言是停止编写自定义操作。了解组件规则文件版本控制规则,让 MSI 为您完成繁重的工作。流程外的自定义操作只会使事情变得混乱。

于 2013-12-05T15:41:59.543 回答