Transitioning from Wise installer - Advanced Installer Community
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Transitioning from Wise installer

Our existing clients have our system which will have been installed using Wise installer. I would like, during the initial install of our new AI installer package, to check for the existence of the file called Unwise.exe (the Wise uninstall program) and if it is found then execute it with two parameters; if the current directory is the AppDir (namely, Program Files\Mfr Name\Product Name, then the command line wound be:
unwise.exe /s install.log

but since the current dir could be anything I think I need to do a Custom Action which launches "unwise.exe" as follows:
[APPDIR]unwise.exe /s [APPDIR]install.log

NOTE: Unwise.exe and Install.log file will be found in the same directory.

Trying this out I'm getting an error as follows:

MSI (s) (70:0C) [17:08:20:294]: Note: 1: 1721 2: Uninstall_Previous_Wise_Install 3: 4: C:\Program Files (x86)\Mfr Name\Product Name\Unwise.exe /s C:\Program Files (x86)\Mfr Name\Product Name\Install.log
MSI (s) (70:0C) [17:08:22:147]: Product: Product Name -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: Uninstall_Previous_Wise_Install, location: , command: C:\Program Files (x86)\Mfr Name\Product Name\Unwise.exe /s C:\Program Files (x86)\Mfr Name\Product Name\Install.log

If I do a command line (outside of an AI installation) that includes double-quotes around both these paths then it works, but I can't seem to find the way to make this work within an AI installation.

This cmd line is an example of what does work:
"C:\Program Files (x86)\Mfr Name\Product Name\Unwise.exe" /s "C:\Program Files (x86)\Mfr Name\Product Name\Install.log"

EDIT: I tried every possible combination of including and excluding double-quotes that I could think of, since the path has spaces in it, and none of my tests so far have been succesful.

Can anyone suggest what it is that I might be doing wrong?

Thanks.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Transitioning from Wise installer

Hi,

Indeed, you should use quotes around your paths, something like this:

Code: Select all

"[APPDIR]unwise.exe" /s "[APPDIR]install.log"
However, the custom action can also fail due to lack of permissions. Remember, you are calling an EXE, so the UAC could automatically reject your call and make the custom action fail.

Since running the custom action as deferred with no impersonation is not an option (as it would execute too late), we need to find another option. Can you please tell us how you are running the MSI packages built by AI? Do you run them in full UI mode or deploy the package through Active Directory or SCCM (0or another tool of this kind)?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Transitioning from Wise installer

Hi Bogdan,
We intend to release our first AI based installer as an EXE (MSI-inside) and it will be run in UI mode.
Our customers are small companies some likely without an IT staff, so we don't have any plans for Active Directory or SCCM modes.

Thanks.

EDIT: Okay I tried your double-quotes example and I still get this error...

MSI (s) (C0:5C) [16:57:24:982]: Note: 1: 1721 2: Uninstall_Previous_Wise_Install 3: 4: "C:\Program Files (x86)\Mfr Name\ProductName\unwise.exe" /s "C:\Program Files (x86)\Mfr Name\ProductName\install.log"
MSI (s) (C0:5C) [16:57:30:116]: Product: ProductName-- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: Uninstall_Previous_Wise_Install, location: , command: "C:\Program Files (x86)\Mfr Name\ProductName\unwise.exe" /s "C:\Program Files (x86)\Mfr Name\ProductName\install.log"
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Transitioning from Wise installer

Hi,

As I said above, the error I suspect appears because of lack of permissions to run the EXE.

You need to schedule your custom action after "Preparing" stage from Install Execute Stage, then set the option "When the system is being modified (deferred)" and "Run under the LocalSystem account with full privileges(no impersonation)".

This should make the custom action have the proper credentials to run and also run just before you install the new files from your package, so the uninstall of the old version should not delete accidentally any of your new files.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Transitioning from Wise installer

Hi Bogdan,
Thanks for the pointers. I tried your suggested settings mentioned and I am still not able to affect the un-install. I continue to get the 1721 error.
Here is what the verbose log reports:

MSI (s) (B0:2C) [10:56:01:576]: Note: 1: 1721 2: Uninstall_Previous_Wise_Install 3: 4: "C:\Program Files (x86)\Mfr Name\ProductName\unwise.exe" /s "C:\Program Files (x86)\Mfr Name\ProductName\install.log"
MSI (s) (B0:2C) [10:56:05:679]: Product: Overture NYLife -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: Uninstall_Previous_Wise_Install, location: , command: "C:\Program Files (x86)\Mfr Name\ProductName\unwise.exe" /s "C:\Program Files (x86)\Mfr Name\ProductName\install.log"

And attached is a screen shot of what the AI project settings looks like now.
Attachments
UninstallWise.png
UninstallWise.png (32.34 KiB) Viewed 12379 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Transitioning from Wise installer

Hello,

I apologize for my delayed reply. Can you please please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Transitioning from Wise installer

Hi Daniel,
I have sent the email as you requested.

Thanks.
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Transitioning from Wise installer

Hi,
I have one more task related to removing a prior "wise" installation of our application. I discovered that the Unwise (uninstaller) removes a very critical INI file that we need to preserve (it contains user customizations of our app) as we transition to the AI installation.

I have the code working to call "Unwise /s install.log" as a "Execute Custom Action" so that's not a problem, but what I can't seem to figure out yet is how do I make a backup copy of our INI file (immediately) before calling "unwise.exe" so that I can restore that backup file (immediately) after, so that the user customizations are not permanently lost.

What I have tried so far hasn't worked. This is what I tried:

I created a Custom Action called "PM_BackupPMUserINI" which calls a simple BAT file:

Code: Select all

copy %1 %2
and in the CA I define the 1st and 2nd params to be the original INI filename and the backup ini filename respectively:

Code: Select all

File To Launch:
[#CopyFile.bat]

Command Line:
"[PublicDocumentsFolder][PM_ManufacturerShortName]\[ProductName]\User.ini" "[PublicDocumentsFolder][PM_ManufacturerShortName]\[ProductName]\User.ini.bak"
Then, I tried wrapping the "PM_BackupPMUserINI" CA (as well as the "PM_RestorePMUserINI" CA) around the (known good) "Execute CA" command in the "Install" button's Published Events, like this:
PushButton_Install_Events.png
PushButton_Install_Events.png (26.6 KiB) Viewed 12181 times
The error that I see when doing this says:
Action start 10:13:37: PM_BackupPMUserINI.
MSI (c) (E8:60) [10:13:37:860]: Note: 1: 1722 2: PM_BackupPMUserINI 3: C:\Users\Cosmos\AppData\Local\Temp\MSI5BCC.tmp 4: /HideWindow "C:\Program Files (x86)\ProMicro\Overture Demo\CopyFile.bat" "C:\Users\Public\Documents\ProMicro\Overture Demo\PM_User.ini" "C:\Users\Public\Documents\ProMicro\Overture Demo\PM_User.ai"
MSI (c) (E8:60) [10:14:05:212]: Product: Overture Demo -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action PM_BackupPMUserINI, location: C:\Users\Cosmos\AppData\Local\Temp\MSI5BCC.tmp, command: /HideWindow "C:\Program Files (x86)\ProMicro\Overture Demo\CopyFile.bat" "C:\Users\Public\Documents\ProMicro\Overture Demo\PM_User.ini" "C:\Users\Public\Documents\ProMicro\Overture Demo\PM_User.ai"

Action ended 10:14:05: PM_BackupPMUserINI. Return value 3.
Info 2896. Executing action PM_BackupPMUserINI failed.
Action ended 10:14:05: WelcomeDlg. Return value 3.
MSI (c) (E8:94) [10:14:05:228]: Doing action: FatalError
Action start 10:14:05: FatalError.

I think that the problem is that the file ("CopyFile.bat") hasn't been added to the the users' hard-drive yet, because it's a new file that I'm including for the first time in my AI installer...how do I solve this?
Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Transitioning from Wise installer

Hello Kevin,

When added as regular file in "Files and Folders" page the "CopyFile.bat" file will be copied on target machine at install time only after "Install Execution Stage -> Add Resources" actions group (in the deferred execution time). Therefore, if scheduled before this moment your custom action will fail because the "CopyFile.bat" file doesn't exist on target machine. However, in order to achieve what you want you should add the "CopyFile.bat" as a temporary file in "Files and Folders" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Transitioning from Wise installer

Hi,
Ok, temporary file sounds like it will do the job.

I added it in the Files & Folders page and AI automatically puts it in the \Windows Volume\Temporary\ folder which I assume is normal; before adding the file I renamed it to "tmpCopyFile.bat" to help me remember the distinction between it and a "normal, installed file".

But when I try to reference this temporary file in one of my Custom Actions (Launch File > Properties > File To Luanch > right-click, select "File..." and in the dialog drill into the \Windows Volume\Temporary\ folder and select the BAT file, when I click OK, the results show that the BAT file has a red-squiggley line below it that says "Invalid identifier."
TemporaryFileInvalidIdentifier.png
TemporaryFileInvalidIdentifier.png (60.82 KiB) Viewed 12147 times
What am I doing wrong?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Transitioning from Wise installer

Hello Kevin,

The temporary file reference is labeled as an "Invalid Identifier" due to an Advanced Installer limitation. We are aware of it an will try to add an improvement regarding this in a future version of Advanced Installer. Until then, you can just ignore this false labeling of temporary file references.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”