If your product was initially installed with InstallAware, it should automatically set the pre-defined variable NEEDSUPGRADE to TRUE if it detects a pre-existing instance of software installed with a matching product code. However, if your product was previously installed with wise, this won’t be the case.
In order for you to upgrade your existing software with InstallAware, which was previously installed by Wise, you’ll need to do the following:
Using the MSIcode command
Read Registry, you should be able to acquire the install path of your software (from HKLM\SOFTWARE\<product_name>\InstallDir).
From that path, you should be able to run unwise.exe to uninstall your software using the MSIcode command
Run Program or
Run Program As. So, it will look something like:
Run Program $installDir$\UNWISE.exe /s /u "$installDir$\INSTALL.LOG" (WAIT)
These changes should be made to the beginning of the script. If you were to create a Basic Setup, you would need to modify the regions:
Check Application Pre-Requisites
Install Application Pre-Requisites
I've included sample code that should help you get it working. If you create a Basic Setup, you'll want to replace the existing regions mentioned above with the code below. If your product title matches what was previously installed, it should "work", however you may need to make slight modifications to suit your specific circumstances.
Code: Select all
~InstallAware Clipboard Data~
~Code Folding Region~
~{7C253023-2D40-490C-818A-12FE2459B2AB}~
~FALSE~
~Copy of Copy of ~
~Comment~
~{82BE833D-7897-4B99-B502-F530ECB252BB}~
~~
~Code Folding Region~
~{17D808CA-18F7-4F14-AC27-0D747587FA32}~
~FALSE~
~Copy of Copy of Copy of ~
~End~
~{9914ED47-0C01-4A9E-AA5B-A0CB67C8DD3B}~
~Hide Dialog~
~{67861B8D-F298-45AC-8731-C6DFD86C3EFA}~
~Compiler Variable End~
~{88AB1AEC-DE7A-424A-9C40-59846291310D}~
~End~
~{422EC0AB-7A10-4A44-82B7-2AB9DD8C2FEB}~
~Comment~
~{6FB2D84A-F3AE-4091-8B71-2BAE89BBFE25}~
~end If Variable NEEDSUPGRADE Equals True~
~End~
~{BA3447FE-0141-494A-AABA-AC2B3FAC605C}~
~Run Program~
~{181F3ADC-1E00-4856-B397-C090C74B9195}~
~$installDir$\UNWISE.exe~
~FALSE~
~/s /u "$installDir$\INSTALL.LOG"~
~TRUE~
~~
~If~
~{C3234B97-40A8-443B-872D-1CC553401928}~
~needsWiseUpgrade~
~0~
~TRUE~
~FALSE~
~Else~
~{A8581690-168D-4706-9652-FA1E848682C1}~
~Set Variable~
~{392B6728-B457-4D58-A0AD-432E4636FDC2}~
~MAINTENANCE~
~FALSE~
~End~
~{02DACF06-2D6B-47D5-B475-5E7BEB2D28F6}~
~End~
~{8AEE8FFB-41E8-4D25-AD08-348479F978D2}~
~Terminate Install~
~{2271A179-9B5F-4CC2-908D-AC4D0C9D6DB0}~
~Else~
~{C642838D-FC7F-4C2A-BD56-9ADCAE792E17}~
~Reboot and Resume~
~{A0E318B0-1D2A-4A5C-86BF-D4929980ADB5}~
~If~
~{1FB5F42F-C1BB-4E69-9B8B-CE5CDE3E883E}~
~REBOOTNOW~
~0~
~OK~
~FALSE~
~MessageBox~
~{A3A8857A-EC48-45EB-B4C9-6DC99C418FF0}~
~$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$.~
~2~
~2~
~REBOOTNOW~
~If~
~{696D50AE-2794-4944-A508-1180C31317D6}~
~REMOVEOLD~
~0~
~REBOOT~
~FALSE~
~End~
~{0F016257-1D3C-4C53-B428-073A62C65A6B}~
~Terminate Install~
~{E9DC6E65-FD4F-41EF-BF15-B5C382507956}~
~MessageBox~
~{211BBA03-4FF3-4EC9-800C-2066696E70A6}~
~$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$~
~2~
~1~
~~
~If~
~{BC06CB5F-9C6B-4F94-A9E1-7F6FFF3C2508}~
~REMOVEOLD~
~0~
~ERROR~
~FALSE~
~(Un)Install MSI Setup~
~{EFE3A7F3-126D-47E1-94E6-EC1A37CDB80C}~
~REMOVE=ALL,TRUE,$PRODUCTCODE$,FALSE,,,REMOVEOLD,ERROROLD,TRUE~
~mMSI.dll\mMSIExec.dll~
~If~
~{486DA02C-8432-4199-A22C-C62E32AF5AC9}~
~NEEDSUPGRADE~
~0~
~TRUE~
~FALSE~
~Set Variable~
~{BC46EB4F-0E6B-480F-9A95-B813D2F061C8}~
~ERROROLD~
~~
~Set Variable~
~{8CD4CDC2-F83D-43E8-AC3A-FF316C9C632D}~
~REMOVEOLD~
~~
~Comment~
~{023CF635-61E3-4C15-9B67-A84632D9C172}~
~moved these outside of the if statement, since they are used for regular IA and also Wise uninstalls~
~Compiler Variable If~
~{C21A662B-4F17-4F7B-ACD5-3C7BEB8ADDE3}~
~BUILDMODE~
~0~
~PATCH~
~TRUE~
~Display Dialog~
~{DB48B38F-8EC9-442B-982F-D5B5F19635F0}~
~progressprereq~
~WIZARD~
~FALSE~
~~
~TRUE~
~FALSE~
~End~
~{04013699-F374-4E9E-8FE5-5B54603B07CA}~
~Terminate Install~
~{43F9A14F-CF49-4988-BD8D-068A403D27CB}~
~If~
~{6DD9E7D7-05ED-4383-ACEB-94606271222D}~
~WIZARD~
~0~
~CANCEL~
~FALSE~
~Display Dialog~
~{E3E22493-179F-4837-86A7-A4DE6196F639}~
~prereq~
~WIZARD~
~TRUE~
~~
~TRUE~
~FALSE~
~If~
~{C8617B8A-131B-416A-B8F7-FD80E6502C5B}~
~PREREQ~
~0~
~FALSE~
~TRUE~
~Comment~
~{C8E5A818-750F-4E80-9C23-FA276EF80447}~
~Install setup pre-requisites~
~Code Folding Region~
~{E42FA77D-9C8E-4428-B788-39A1B3E3DD09}~
~TRUE~
~Install Application Pre-Requisites~
~Comment~
~{BC2F5B41-0288-481D-A31E-5FEF8508B8E1}~
~~
~Code Folding Region~
~{CCFD424E-1BEF-4245-9444-2E9D3F2DB9B5}~
~FALSE~
~Copy of Copy of Copy of Copy of ~
~Compiler Variable End~
~{9EE5B999-4EDA-4DEC-A7B4-7822304730D6}~
~End~
~{DB4E4304-4DF7-49B0-B8D9-42C672F84073}~
~End~
~{E54946A3-8A94-4550-8ADC-A952F453C9C3}~
~Set Variable~
~{359F8ABD-706A-40AB-B140-FB1BA5FD9FD4}~
~PRELIST~
~$PRELIST$$NEWLINE$Previous Version Uninstallation~
~Set Variable~
~{2F5F2A24-1516-4704-A128-A3F095515F79}~
~PREREQ~
~TRUE~
~Comment~
~{4CFC2FF9-D71D-4171-BF61-96E71C42CD21}~
~~
~Set Variable~
~{E2651136-B02D-44BB-9918-0D8A61A6F543}~
~installDir$MYAH$MYAH$FALSE~
~$regVal$~
~Set Variable~
~{6D0ED624-FCA1-4C29-A799-CC6205E24BD8}~
~needsWiseUpgrade$MYAH$MYAH$FALSE~
~TRUE~
~MessageBox~
~{B638AB71-42A1-4C1E-B5E7-A6D25303C9C9}~
~set true~
~Set needsWiseUpgrade = TRUE~
~0~
~1~
~~
~If~
~{589A6AC2-B69A-4982-9844-A90C6F47161D}~
~regVal~
~0~
~~
~TRUE~
~MessageBox~
~{727D4EAF-F97A-46DC-8226-576D24292F36}~
~checking~
~registry value = $regVal$~
~0~
~1~
~~
~Read Registry~
~{B66FE826-C43F-4A88-8F67-25C6EB662C55}~
~regVal~
~2~
~SOFTWARE\$TITLE$~
~InstallDir~
~Comment~
~{38E18138-869D-476F-819E-16DCCF88575C}~
~Check for previous Wise installation~
~Else~
~{1BBEA8C8-3A7B-4721-B79C-C0EA20F30BAA}~
~Set Variable~
~{98570755-D2D7-41E3-970D-2829B3A37950}~
~PRELIST~
~$PRELIST$$NEWLINE$Previous Version Uninstallation~
~Set Variable~
~{43D56549-21B8-4D92-8605-6817F28FDB0F}~
~PREREQ~
~TRUE~
~If~
~{2396ADED-A42E-4C09-80E6-30D02341E8CF}~
~NEEDSUPGRADE~
~0~
~TRUE~
~FALSE~
~Set Variable~
~{109ACF65-D78A-4C3F-9921-CE75B688DB96}~
~needsWiseUpgrade$MYAH$MYAH$FALSE~
~false~
~Comment~
~{ED807BE9-B683-4FE8-B7A0-EBE269036CEA}~
~NEEDSUPGRADE needs customized approach to upgrade software previously installed by Wise Installer~
~Compiler Variable If~
~{34B2983A-A68F-41CC-998D-8D7B8B0576FC}~
~BUILDMODE~
~0~
~PATCH~
~TRUE~
~Set Variable~
~{5CE1A8D9-980B-4321-A4CD-4D8B89E6F5F3}~
~PRELIST~
~~
~Set Variable~
~{6D0565D9-B858-4166-BC8E-52B578F22FF8}~
~PREREQ~
~FALSE~
~Comment~
~{DA33A897-4570-44ED-996C-49762D92A250}~
~Check setup pre-requisites~
~Code Folding Region~
~{AC07BC9A-1070-4A04-A997-2C5404248651}~
~TRUE~
~Check Application Pre-Requisites~
~Comment~
~{0075C922-79F5-43B4-BE72-64F951F542B3}~
~~
~Code Folding Region~
~{085DCDA1-617B-4B9F-AE7F-2C1FBBD110E6}~
~TRUE~
~Check/Install Application Pre-Requisites~
~Comment~
~{15C391DD-9DEC-4435-9516-433C2DAF1A94}~
~~
~Code Folding Region~
~{7C9C0255-DB35-4F52-9387-E1A49A369ADB}~
~FALSE~
~~
~Code Folding Region~
~{86DA1A3D-F1F1-4D64-86AF-D0421EC35E59}~
~TRUE~
~Check Application Requirements~
~Comment~
~{70244170-D523-4C21-8D96-3D66E000E4DA}~
~~
~Comment~
~{C4126339-9C52-470F-82F2-5238A80FC39D}~
~~
~Set Variable~
~{95926119-E195-4FAE-AD08-39BCF0010C25}~
~installDir$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{09A7A030-1D52-4DD6-906F-F63430B332CD}~
~regVal$MYAH$MYAH$FALSE~
~~
~Comment~
~{5C94F1C3-630B-45CD-B608-D69860E44A7F}~
~For reading registry:~
~Comment~
~{5E61FE50-0CDF-445A-A7B4-DF674114E630}~
~~
~Comment~
~{5F0A747B-B0DC-41EA-B812-9EE1552B2695}~
~Project designed to "upgrade" a software previously installed by Wise~