X5 Multiple Questions

Got a problem you cannot solve? Try here.
essulzer_tltd
Posts: 6
Joined: Tue Oct 25, 2016 2:04 pm

X5 Multiple Questions

Postby essulzer_tltd » Mon Nov 07, 2016 10:58 am

I have been working with X5, creating a native installer package. I have run into 2 issues that I cannot seem to find answers to.

Problem 1: I am doing a basic registry key check to see if Java is installed, and if it exists, checking the version. I have the code that if the key exists, go to the check of the version. Otherwise, it is supposed to display a message box warning. I have run into issue on HP laptops, that completely ignored these lines of code. The logic is to fire off whether the key exists or not. The only determination is what the message says. The laptop in question never executes this code. I have tried on multiple HP laptops, as well as using a blank project. This is consistent behavior.

Problem 2: As I am testing builds of the installer, I test out uninstalling between builds. I am using the "Apply Uninstall" command, but when uninstalling between builds, I receive the error: "This action is only valid for products that are currently installed." When I uninstall using "Programs and Features", the uninstall works fine (same build version). What is causing this issue, and how can I resolve?

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: X5 Multiple Questions

Postby FrancescoT » Mon Nov 07, 2016 2:31 pm

Dear Essulzer_tltd,

Problem 1: which registry key are you checking? If you are checking for a registry key under HKEY_LOCAL_MACHINE on a x64 target OS, please consider that by default, this may be redirected to the respective x32 bit location of the target registry.
https://www.installaware.com/forums/viewtopic.php?f=2&t=10813

Problem 2: I am not quite sure to follow how you are using the "Apply Uninstall" command. By the way, It's exactly the "Apply Uninstall" command that gets called when uninstall using "Programs and Features" from control panel.

Do you have any chance to post a very minimal project that replicates your issue?

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

essulzer_tltd
Posts: 6
Joined: Tue Oct 25, 2016 2:04 pm

Re: X5 Multiple Questions

Postby essulzer_tltd » Tue Nov 08, 2016 11:07 am

Thank you for the information about the x86 vs x64 setup mode. I will double check that on my next build.

For problem 2, here is a sample of the code that we run. It is checking for an older version (6.x, we are building 7.x now). It removes the 6.x version, but if the 7.x version is detected, unless it is the exact same build version, I receive the error that I mentioned.

Code: Select all

~InstallAware Clipboard Data~
~End~
~{3EF983B1-1D89-4426-AB84-BAE9986D5BAC}~
~Apply Changes~
~{737827B7-0A85-4F9C-AC20-7ED3CEBE80E3}~
~progress~
~SUCCESS~
~FALSE~
~TRUE~
~Set Variable~
~{E303569A-47A0-407F-A388-8F3B10CBE3BC}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: Removing $TITLE$~
~Set Variable~
~{E973246C-D216-48B3-BE68-1A38510D1178}~
~PROGRESSTEXT$MYAH$MYAH$FALSE~
~Removing $TITLE$~
~Else~
~{34C8B5CF-6C72-45D9-B03E-6F7981124758}~
~(Un)Install MSI Setup~
~{19C32660-D042-4F36-9F7F-38FF9042E454}~
~REMOVE=ALL,TRUE,$GUID_VERSION_6X$,FALSE,,,REMOVEOLD,ERROROLD,TRUE~
~mMSI.dll\mMSIExec.dll~
~Set Variable~
~{848988C0-1DA1-414F-929E-21F7E55D9FF1}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: Removing $TITLE$ v6.1 - v6.5~
~Set Variable~
~{12BECE5C-ABD2-4344-9986-08A143E58A90}~
~PROGRESSTEXT$MYAH$MYAH$FALSE~
~Removing $TITLE$ v6.1-v6.5~
~Set Variable~
~{76F7E930-F76D-4C91-9CA0-3F2C23C5DF9D}~
~LASTERROR$MYAH$MYAH$FALSE~
~$TIME$: The installer has detected a previous version of $TITLE$ already installed on this machine.  We will now attempt to uninstall that version.  This installer should be able to remove versions 6.1 through 6.5.  If it is not successful, the previous version of $TITLE$ will need to be uninstalled manually before this installation can continue.~
~MessageBox~
~{89DCA049-F47D-4446-B3F7-02C16A4B3D6A}~
~$TITLE$ - Previous Version Detected~
~The installer has detected a previous version on $TITLE$ already installed on this machine.  We will now attempt to uninstall that version.  This installer should be able to remove versions 6.1 through 6.5.  If it is not successful, the previous version of $TITLE$ will need to be uninstalled manually before this installation can continue.~
~0~
~1~
~~
~If~
~{E66A482D-9E5A-46D9-82D9-3FFE23C8F229}~
~V6X_EXISTS~
~0~
~NO$KEY~
~TRUE~
~Check Registry~
~{C24F93A9-55B5-44E2-B0F8-AF64FFD944B4}~
~V6X_EXISTS|~
~2~
~Software\Microsoft\Windows\CurrentVersion\Uninstall\$GUID_VERSION_6X$~
~~

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: X5 Multiple Questions

Postby FrancescoT » Tue Nov 08, 2016 2:39 pm

Dear Essulzer_tltd,

you cannot call Apply Uninstall in that way. This because you are not trying to uninstall an installed version of the product, but instead you are trying to uninstall from the current installer, the product which has not been installed yet.

Under Native Engine, you may use the RECOMMENDEDUPGRADE pre-defined variable. This is TRUE if a previous version of the product was found installed using the native code setup engine, FALSE otherwise. When this variable is TRUE, if a new version of the product is installed using the native engine before the old version has been removed successfully, the only guaranteed way to uninstall the old version will be to run the original setup file for the old version.

At such purpose you can use the cached setup sources of a product installed using the native code engine. To get the exact location of the cached setup exe, you can query the target registry.

This value is stored as "(Default)" value under the following key;
- HKLM\SOFTWARE\MimarSinan\InstallAware\Ident.Cache\<PRODUCTCODE>
or with a x64 target OS;
- HKLM\SOFTWARE\Wow6432Node\MimarSinan\InstallAware\Ident.Cache\<PRODUCTCODE>

Finally to uninstall the package from your setup script, use the RUN PROGRAM command to execute the original setup file for the old version and for a silent uninstallation, use "/s MODIFY=FALSE REMOVE=TRUE" as command parameters.

PS.
Alternatively and when installing a package, to keep track of the "cached setup sources" you may also use the "UNINSTALINK" pre-defined variable. This points to the "cached setup location" of the current installation (the full path of the cached setup executable).

In other words, you may store the "UNINSTALINK" value under a registry key or within a file and then to use it from successive versions of your installer.

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

essulzer_tltd
Posts: 6
Joined: Tue Oct 25, 2016 2:04 pm

Re: X5 Multiple Questions

Postby essulzer_tltd » Tue Nov 08, 2016 5:23 pm

That is a very valuable piece of information there. I appreciate that, and I am sure it is going to make things work a lot better!

I am back at problem 1. I have forced the 64 bit native mode (where appropriate), checking for the following key: HKLM\SOFTWARE\JavaSoft\. From my research, the only 2 values this key should return are NO$KEY or NO$VALUE. I am checking for and receiving NO$VALUE but the conditional statement is not launching. Please see code snippet below. This specific machine is an HP laptop.

Code: Select all

~InstallAware Clipboard Data~
~End~
~{48418585-5615-4B9C-9619-2014B6A161CD}~
~End~
~{F009E20A-4DFB-4B42-B102-26F6E62CC3C4}~
~Set Variable~
~{E0D251A5-2EBE-4DCD-80DE-A9DFCFCFDB5D}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: Java has been detected, but does not meet the minimum required version (1.8 update 101). Some reporting functions will not work correctly.~
~MessageBox~
~{68252D09-8381-4D5D-B1B0-D744000221DF}~
~$TITLE$ Setup Warning~
~Java version 1.8 has been detected.  Please confirm that the machine is running update 101, otherwise some reporting features will not work correctly.~
~2~
~2~
~~
~If~
~{A5CC3ACD-652E-46BE-A36B-B26820293173}~
~JAVA_CHECK~
~1~
~1.8~
~FALSE~
~End~
~{46CA36E4-95BC-4A47-A14C-9DC761BCC5DF}~
~Set Variable~
~{ED0DE624-EBB4-4FB8-B2E9-179082CCEE05}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: Java has been detected, but does not meet the minimum required version (1.8 update 101). Some reporting functions will not work correctly.~
~MessageBox~
~{52602D2A-4CC6-46D0-BB2B-DE9996648563}~
~$TITLE$ Setup Warning~
~Java has been detected, but does not meet the minimum required version (1.8 update 101).$NEWLINE$$NEWLINE$Some reporting features will not work correctly.~
~2~
~2~
~~
~If~
~{A2A1AFBF-E0E2-42A2-88C1-ECD083F098FE}~
~JAVA_CHECK~
~1~
~1.7~
~FALSE~
~End~
~{39EBF557-D414-49D0-9797-682B33DD2342}~
~Set Variable~
~{322F633E-7DF2-4C83-8858-0D1AB6D87768}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: Java has been detected, but does not meet the minimum required version (1.8 update 101). Some reporting functions will not work correctly.~
~MessageBox~
~{62E551C2-0A64-485F-B4C6-97DEC33D02C5}~
~$TITLE$ Setup Warning~
~Java has been detected, but does not meet the minimum required version (1.8 update 101).$NEWLINE$$NEWLINE$Some reporting features will not work correctly.~
~2~
~2~
~~
~If~
~{6E1996A7-64ED-44E7-97E7-EC75B0013D56}~
~JAVA_CHECK~
~1~
~1.6~
~FALSE~
~Check Registry~
~{2D6C019A-2C08-4A49-A94E-606002B66E9B}~
~JAVA_CHECK|~
~2~
~SOFTWARE\JavaSoft\Java Runtime Environment~
~CurrentVersion~
~If~
~{471D4265-5158-4F68-96CD-19B78A8A1288}~
~JAVA_INSTALL~
~4~
~NO$VALUE~
~FALSE~
~End~
~{888B88A2-00E0-44F0-8329-F8FEDFE14B0E}~
~Set Variable~
~{FF69C92A-171F-4B52-A96D-CDCC20822F4C}~
~LASTERROR$MYAH$MYAH$FALSE~
~$LASTERROR$$NEWLINE$$TIME$: This product requires at least Java JRE version 1.8 Update 101.  Some reporting functions will not work properly.~
~MessageBox~
~{30B4EBAF-098E-4021-AE16-FE664E836F83}~
~$TITLE$ Setup Warning~
~This product requires at least Java JRE version 1.8 Update 101.$NEWLINE$$NEWLINE$Some reporting features will not work correctly.~
~2~
~2~
~~
~If~
~{E22B6688-4D99-4685-B8CC-91DCB6EFA93B}~
~JAVA_INSTALL~
~0~
~NO$KEY~
~FALSE~
~MessageBox~
~{56103AAE-76A0-4812-972A-2213259578B3}~
~DEBUG~
~JAVA_INSTALL= $JAVA_INSTALL$~
~0~
~1~
~~
~Check Registry~
~{BF56D361-202C-4B14-B244-A76CE42B93C4}~
~JAVA_INSTALL|~
~2~
~SOFTWARE\JavaSoft~
~~

Your help is definitely appreciated with this!

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: X5 Multiple Questions

Postby bokkie » Wed Nov 09, 2016 4:00 am

I get the result NO$VALUE as well. I put a message box inside the "if" and it's being displayed. However, when I display the JAVA_CHECK variable, it displays NO$KEY but inside the "if" you have checks for 1.6, 1.7 and 1.8 but there's no other check for anything else. That would give the impression the "if" isn't being run as you expect? That is it's running quietly without really doing anything by the way of feedback.

Can you put a message box inside your "if" where you check JAVA_INSTALL's value if only to prove 100% that the"if" is or isn't working?

Another thought comes to mind. Is the "if" block itself inner scope to another "if", perhaps something that checks for a specific OS or some other resource known to your HP laptop which is environmentally different to another machine where it does work? :?:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: X5 Multiple Questions

Postby FrancescoT » Wed Nov 09, 2016 8:03 am

Dear Essulzer_tltd,

attached you find a very small project that I used to verify your script. For what I see this works correctly and as follow.

Without any Java RTM installed;
img3.png
img3.png (63.84 KiB) Viewed 7784 times

...then
img4.png
img4.png (59.02 KiB) Viewed 7784 times

with the Java RTM installed "v.1.8";
img1.png
img1.png (80.77 KiB) Viewed 7784 times

...then
img2.png
img2.png (58.08 KiB) Viewed 7784 times


NOTES!
- it's not necessary to use the x64/x32 mode switch. This due the fact that the Java RTM is Always installed as native 32 bit package. Consequently on a x64 target OS, its registry Keys are Always stored under the 32 bit node of the target registry.

- I used a Win 7 x64 machine to test the code. With this specific OS I found that the key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft" seems to be present by default with the system. Of course by default this is empty (...the Java RTM is not installed), but maybe, this key may be not available by default with all Windows versions ... so probably, this may explain the different behavior when using different target systems.

Hope this helps you.

Regards
Attachments
regkey_test.rar
(1.73 MiB) Downloaded 280 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

essulzer_tltd
Posts: 6
Joined: Tue Oct 25, 2016 2:04 pm

Re: X5 Multiple Questions

Postby essulzer_tltd » Wed Nov 09, 2016 9:48 am

Thanks for the verification. The machine I'm testing on is a x64 Windows 10 machine, that has the x64 version of Java on it. I will go back to the drawing board and see what I'm missing.

Thanks for your help.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 32 guests