Target Folder Incorrect

Got a problem you cannot solve? Try here.
MikeS
Posts: 16
Joined: Wed Jun 05, 2013 11:54 am

Target Folder Incorrect

Postby MikeS » Tue Sep 22, 2020 2:47 pm

Installaware X11 Developer

When going through installation, the Target Folder I enter in IA Project Properties is not always what's entered when the user goes through the install process. It seems to be about 50/50 whether the correct path displays as I set it or IA inserts “Program Files (x86)” into the path.

I removed the “Program Files (x86)” from the Target in Project Properties:
Image


However, when users go through the install, “Program Files (x86)” gets inserted into the install path and that’s where customers end up installing to.

Image

I have a message in the Read Me to tell users to install into c:\presstimator instead of c:\program files\presstimator, but most people don’t read the Read Me so they just go through the defaults. I’m not sure why/when/what circumstances IA adds back in the “Program Files (x86)” instead of using my Target Folder.

Any idea how to have IA use my Target Folder without “Program Files (x86)” be added?

Image

I have users install to root c:\presstimator because I’m using a SQL Server LocalDB for my trial software. When installing to “program files”, Microsoft can restrict read/write to the folder so my trial software won’t work correctly. I also have report template files that are loaded and Microsoft can block access to those as well. Microsoft (and businesses I’m selling to) can be very restrictive with what they allow as far as read/write in the “program files” folder so I try and avoid this by installing to root c: drive as the default. However, IA will sometimes insert the “Program Files (x86)” into the path. When users call me because they get a read/write error, I have them un-install from the “program files” folder and then re-install and make sure the path is root c drive. Then, everything works perfectly. That’s why I need to have the path stay what I set it to instead of including “Program Files (x86)”.

Here’s the only stuff I see in the script that deals with the path so I don’t know how it gets changed:

Image

Image

Image


From this, I could see if they had a previous installation to “Program Files (x86)”, then it would see that old target and use it, but this seem to happen for new installs.

Thanks.

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

Re: Target Folder Incorrect

Postby FrancescoT » Wed Sep 23, 2020 10:09 am

For what I see your approach appears correct ….but it may exist a condition that needs to be taken in account.

If you let the user to browse for the install directory (Destination Dialog), there is still the possibility that an user may select the "Program Files" folder. So in your case, I may suggest you to not display such dialog, or to replace it with a customized version without "browse for folder" capabilities.
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

MikeS
Posts: 16
Joined: Wed Jun 05, 2013 11:54 am

Re: Target Folder Incorrect

Postby MikeS » Wed Sep 23, 2020 1:22 pm

Hi Francesco. Thanks for your reply. If the user just plows through the install dialogs, just accepting the defaults and not browsing, it still gets defaulted to include "Program Files (x86)" sometimes. Not all the time - just some times (about 50/50 chance from what I've seen). It happens on my install test machines as well. I can't figure out what the scenario is for when it has "Program Files (x86)" inserted as it doesn't always happen. And, on the same machine it will happen and not happen. I cannot remove the Browse dialog since I may need it when the user needs to un-install from the "Program Files (x86)" folder and then Browse to set to root folder. The user (me or end user) definitely isn't entering in "Program Files (x86)" since we set the default for them and tell them where to install in the ReadMe, yet somehow it's getting inserted.

Any other way this can happen?

Thanks.

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

Re: Target Folder Incorrect

Postby FrancescoT » Thu Sep 24, 2020 11:18 am

Are you loading the locally stored "feature state data" only when upgrading ?

Code: Select all

if Variable NEEDSUPGRADE Equals TRUE
     
    Comment: Load previous feature state data
    Load Feature Selections from file $ALLAPPDATA$\$COMPANY$\$TITLE$\features.data
    Set Variable OLD_TARGETDIR to $TARGETDIR$
    ...
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

MikeS
Posts: 16
Joined: Wed Jun 05, 2013 11:54 am

Re: Target Folder Incorrect

Postby MikeS » Thu Sep 24, 2020 11:41 am

Hi Francesco. No. The only instances of TARGETDIR are the ones I sent prior.
Thanks.

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

Re: Target Folder Incorrect

Postby FrancescoT » Thu Sep 24, 2020 1:12 pm

In such case, this may be the reason of your issue.

You should load the locally stored features only when upgrading an already installed version.

Code: Select all

if Variable NEEDSUPGRADE Equals TRUE
     
    Comment: Load previous feature state data
    Load Feature Selections from file $ALLAPPDATA$\$COMPANY$\$TITLE$\features.data
    Set Variable OLD_TARGETDIR to $TARGETDIR$
    ...

Then in addition, you also should have care to delete your "prestimator_setup.data" on uninstall.
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

MikeS
Posts: 16
Joined: Wed Jun 05, 2013 11:54 am

Re: Target Folder Incorrect

Postby MikeS » Fri Sep 25, 2020 1:22 pm

Hi Francesco. Thank you so much for your help. I'm a little confused though (obviously). I didn't alter the script, so is this something I set up incorrectly? This project has been upgraded through many versions of IA since 2011. Do I need to make changes to the script (I've never done that before).

Here's the script up until the dialogs start.

As you can see, there's only two instances of checking for NEEDSUPGRADE.

Image


And, there are the instances of setting the TARGETDIR.

What's strange is that it says:

Line 29: Set Variable OLD_TARGETDIR to
(and the rest of the line is blank)

Line 83 sets OLD_TARGETDIR to TARGETDIR

Line 141 - 145
Line 141: If Variable OLD_TARGETDIR Equals
(and the rest of the line is blank)

Are these supposed to be empty comparisons?

You also mentioned "delete you presstimator_setup.data on uninstall". Is this a checkbox somewhere or more script that needs to be written?

Thanks!

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

Re: Target Folder Incorrect

Postby FrancescoT » Mon Sep 28, 2020 10:48 am

Dear Mike,

your script contains a couple of minor errors, and these can explain why the installer gets defaulted to include "Program Files (x86)" sometimes. Not all times, of course.

For example, your "NEEDSUPGRADE" block (the second NEEDSUPGRADE" instance).
Here at the very beginning of the conditional block, and prior of any other statement, you should exclusively load the locally stored copy of your "presstimator_setup.data" (if any).

So your "NEEDSUPGRADE" block (the second NEEDSUPGRADE" instance) should be:

Code: Select all

if Variable NEEDSUPGRADE Equals TRUE
     
    Comment: Load previous feature state data
    Load Feature Selections from file $ALLAPPDATA$\$COMPANY$\$TITLE$\features.data
    Set Variable OLD_TARGETDIR to $TARGETDIR$
    ...
end

The above NEEDSUPGRADE block gets executed exclusively when a previous version of the product was found installed (using the Windows Installer engine). This means that this block only comes in play when: you run a new build of your installer (the new "setup.exe" file) on a machine where is already installed a previous version of the same product.

The above block is never executed if the already installed version gets removed via Add Remove Program (Control panel).

Due of this, you should not delete the locally stored copy of "presstimator_setup.data" from the NEEDSUPGRADE block.
At contrary, such file should be deleted by the same setup instance who created the file (the already installed version).

Consequently, such file should be deleted from the "Un-install" block of your setup script.
uninstall_block.png
uninstall_block.png (16.86 KiB) Viewed 12177 times

The above "REMOVE" block gets executed ONLY when: the installed setup instance (the already installed version) receives an UNINSTALL request.

In conclusion, I suggest you to give a look at the setup script code of the "Features sample (2)", from:
https://www.installaware.com/forums/viewtopic.php?f=2&t=6772

The sample does nothing special (it's a very minimal project), but it demonstrates how to keep track of features selection and TARGETDIR, across different setup versions.

Hope this helps you.
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

MikeS
Posts: 16
Joined: Wed Jun 05, 2013 11:54 am

Re: Target Folder Incorrect

Postby MikeS » Tue Sep 29, 2020 1:15 pm

THANK YOU Francesco!! I think I found the places you referenced and made the modifications in the script. I'd never modified the script directly before as I always worked through the setup screens instead. I think I'm all set.

Thanks again for your amazing help!


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 61 guests