0
votes

I have an MSI installer, which have my custom installer project output and I added an exe file to run while installation.

So my MSI setup file will copy or remove files from source location and my custom GUI will install my window server call some server api's and updated its logon credentials etc stuff.

Copying and removing is of files is controlled by MSI on its action as its added as output for MSI project. If I am installing its will copy files or if I uninstall it will remove files.

Now I have below problems -

1) Now if I will go to control panel and try to uninstall my application and later from GUI if I abort it, my GUI will abort but MSI will clear all files.

2) If I will select uninstall and further from GUI, select repair. It will still remove files.

So my installer is not real custom installer, its just namesake one.

Now how can I quick fix above two options? And is there any better approach to do this task - > my original question create single click msi file of custom installer of an application ?

Thanks in advance

2

2 Answers

1
votes

It sounds like you are trying to do things at the wrong time. In any installation system you should gather all user input up front and then once the installation itself starts there should be no further requirement for user input until everything is done.

The easiest way to ensure integrity is to only let the user cancel during the UI gathering phase, not the installing phase. If you do want to let the user cancel during the install phase, you have to pass that on to the underlying engine so that it knows to cancel and rollback any changes made thus far.

0
votes

It seems to me that you need to set proper conditions for your actions like one that initiates your exe-file execution. Try setting something like "Not installed" so that it would occur only during initial installation but not during remove/repair or upgrade.