Dear Francesco
I don't explicitly initialise compiler variables in my code. They are defined in Project Settings - some have a value and others default to 'empty'. Their values are set or changed from the command line as 'user parameters', e.g "RSS_BETA_VERSION=2.2Beta" or "RSS_BETA_VERSION=", in my build script.
This code is a copy of the code that runs when explicitly un-installing, and the compiler variables must have the correct value, because that works.
I will try changing the failing code to have a hard-coded value for the compiler variable, and see what happens.
<EDIT>
I removed the RSS_BETA_VERSION compiler version from the code, as its current value is 'empty'.
Unfortunately, the folder did not get renamed when uninstalling at the start of a new install.
Here is a description of what is supposed to happen:
1. The installer creates and populates a folder called 'resources' in the user's home directory. We need to keep its contents after the product is uninstalled, as changes are needed by the next version.
2. During un-installation, the 'resources' folder is renamed to 'resources-old' ('move' is used for this, though it actually does a copy, as 'resources' is still there)
3. as 'resources' was created by the installer, it gets removed, anyway.
This is what happens when I explicitly uninstall the product. It should happen when the current version is uninstalled as part of installing a new version 'over' the current one. This is the most likely scenario, so it is most important that this happens at this time.
The code, in full context, looks like this (my lines are highlighted with a '<==)':
Code: Select all
Display Dialog: progressprereq, use as progress dialog (non-modal)
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
Comment: Copied from the un-inststall section below - used here when uninstalling current product, as part of installing new version <==
Set Variable NATIVE_ENGINE to TRUE <==
Move Local Files $MYPROFILES$\Romonet\$TITLE$\resources\*.* to $MYPROFILES$\Romonet\$TITLE$\resources_old\ (include subfolders) <==
Set Variable NATIVE_ENGINE to FALSE <==
Apply Uninstall (get result into variable SUCCESS) <==
Comment: End of delete and rename code, copied from the uninstall section <==
Set Variable REMOVEOLD to
Set Variable ERROROLD to
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
if Variable REMOVEOLD Equals ERROR
MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
Terminate Installation
end
if Variable REMOVEOLD Equals REBOOT
MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
if Variable REBOOTNOW Equals OK
Reboot Computer and Resume Setup
else
Terminate Installation
end
end
Set Variable MAINTENANCE to FALSE
end
[compiler end]
Hide Dialog
</EDIT>
Regards, John