Reputation: 2399
I am using the latest release of WiX to build my installer projects, and need a solution to my problem...
When I install ProductA.msi, i want ProductA.msi to copy itself into a directory, call it %PROGRAMFILES%\ProductA\Installer- so that the installer i used is available for re-use at %PROGRAMFILES%\ProductA\Installer\ProductA.msi
Does anyone know if this is possible?
Upvotes: 2
Views: 923
Reputation: 475
I needed to do the same thing and ended up tossing in a powershell script as a custom action. WiX has the [OriginalDatabase] property which points to the .msi being run. I just passed that in as an argument to a quick script and it works.
param(
[string]$MsiLocation
)
echo "Creating directory"
md -Force "C:\directory"
echo "Removing current files"
rm "C:\directory\*"
echo "Copying in new .msi"
cp "$MsiLocation" "C:\directory\"
It's not elegant but it gets the job done. You can see this answer for more details.
Upvotes: 0
Reputation: 168
I am not sure if what you like to do is ok.
BUT: You can write a .bat File with robocopy that copies the msi and its files to destination and starts the .msi afterwards.
Upvotes: 1