Page 1 of 1

Script to be able to add or remove files through MSI?

Posted: Wed Jan 15, 2020 12:42 pm
by jgq1985
Product, version and build: 5.7.171
32 or 64 bit version of product: 64
Operating system: Windows 10
32 or 64 bit OS: 1903


Hello, I was wondering if someone could guide me on this...
I'm looking to write a script that will copy files to a directory.
For example, copy folders and files from \\server\share\folder to c:\programdata\here.
That part I can figure out...

But if I want to package it into an MSI, will it do that upon install? Or do I just make a blank script and make an MSI that copies files to a specified directory?
And say I wanted the MSI uninstall to remove the files it copied by calling a remote uninstall on the system, would the MSI do that inherently? Or would that require scripts?

Re: Script to be able to add or remove files through MSI?

Posted: Mon Jan 20, 2020 10:01 am
by Alexander Riedel
I am not quite sure what you try to accomplish and how. An MSI is generally used to install files on a machine (among other things) and to remove them on uninstall.
In general, that requires no extra script, since the files in question are contained in the MSI.
I am not sure why you'd need an extra script or why an MSI would need a 'remote' uninstall?
Nothing gets executed automatically on install by default. You'd need to define a custom action to do that and yes, you can use PowerShell scripts for that.

An initial read of the Windows Installer documentation (https://docs.microsoft.com/en-us/window ... ler-portal)
would probably be a good idea.