I want to remove old version of software being installed in PowerShell script.
How to do this?
Can I get the sample script?
Could you please tell me what the encountered error is here?When try installing our package, if old version already exists in the application folder, an error occur. In this case, we uninstall it from Windows and install new package. I want to delete existing package before we install new package. I want to do this from PowerShell script.
Please note that the "PowerShell Automation" feature is intended to help automate the creation of your project through PowerShell (e.g. creating a new Advanced Installer project, adding files to it, setting icons, etc.).I've looked into the PowerShell Automation document but couldn't figure out how to do in PowerShell script.
With that being said, to avoid this, we need to do two things:Also, it is important to note that two products with the same ProductCode can not be installed on the same computer. Windows Installer will prevent this with an error reading:
Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel.
I am not quite sure I understand your question here. Could you please give me some more details?BTW, is the GenerateProductCode() provided? I can't find it from the Advanced Installer document.