cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JimmiLee
Level 6

MAINTENANCE is 1, even on first install!

I've been trying to get an installscript working, that copies three files to another application and deletes them again, when uninstalling by doing this:

if MAINTENANCE then
delete files
endif;


The copying works fine, but it deletes them immedeately after, because MAINTENANCE is set to 1 - how can this be?
I tried uninstalling and then installing, as well as installing on a virgin VPC to no avail . . .

Anyone got an idea?

Edit:
I found that when uninstalling, MAINTENANCE is set to 0 - isn't it supposed to be the other way around?
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

Is this an InstallScript project, or an MSI project with InstallScript actions?
0 Kudos
JimmiLee
Level 6

This is an MSI Project with Installscript Actions . . .
0 Kudos
RobertDickau
Flexera Alumni

To detect maintenance mode in a Basic MSI project, you might consider using the same condition as MaintenanceWelcome on your custom action, instead of the MAINTENANCE variable in your script...
0 Kudos
JimmiLee
Level 6

So I basically make a function (DeleteDLLs) and instead of checking for MAINTENANCE, I simply put it in a Custom Action that runs after MaintenanceWelcome, which should only exist in an uninstallation - I'll try that straight away 🙂

That didn't work - it runs the deletion of files in both the installation and the uninstallation, albeit before the copying of the files. However, since it also runs the copying in both the installation and uninstallation, in the uninstallation it then first delets them and then copies them back - what the . . .
Although if I uninstall by double clicking the MSI package (as opposed to going through control panel -> programs and features) and choosing remove, it only deletes them, without copying them back . . .

However, there should be some kind of condition that would allow me to do this properly...
0 Kudos
JimmiLee
Level 6

Since the installation folder of the 3 files I need to copy (and then delete on uninstallation) is inside another application:
[MSCRM installation path]/CRMWeb/bin

I made a script that reads this path from the registry and puts it in a global CRMINSTALLDIR, however, I don't know how to put this global (path) as a directory in the Files and Folders view - figured if I could create a predefined folder named [CRMINSTALLDIR] and then simply create the /CRMWeb/bin structure underneath, but haven't figured out how to do this just yet . . .
0 Kudos