Page 1 of 1
Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 8:08 am
by NickDay
Using InstallAware 11, I tried
Set Variable TARGETDIR to
to empty it, before displaying the Destination Directory dialog, as with my installer the user must browse to an existing location.
However the 'Remaining Disk Space' on this dialog was displayed as a negative number. I don't know whether you'd consider this a bug. I see it is using "Disk Space Difference" for this field; I don't know whether I have any control over that value.
Is there a simple method to force the 'Remaining Disk Space' field to be blank, if TARGETDIR is blank, please?
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 11:01 am
by giaviv
Hi,
Lets start with why you want to set the TARGETDIR to blank? What is the reason for that?
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 2:12 pm
by NickDay
Hi Aviv,
My installer installs items into an existing folder on the PC (it contains an application and its support files). There might be several of these, and the person running the installer must choose which one they want to install into. By default, my installer was displaying C:\Program Files\thenameofmyinstaller
Actually, the name of my installer is pretty immaterial in this case, and this path is inappropriate. I need them to browse to the folder into which my installer will put files.
The files will be installed into the directory they choose, and no 'thenameofmyinstaller' folder should be created.
After I sent this question, I changed my installer to use the native engine (so I can use transform instance). This has introduced a further problem: I noticed that the Destination Directory then (after they had browsed to the target folder) is C:\thefoldertheybrowsedto\thenameofmyinstaller. This is not what I want.
Using the old engine, it was just C:\thefoldertheybrowsedto, which _is_ what I want.
I'm not at work right now, so I have not been able to double-check this by swapping back and forth between the two engines.
So I hope you now understand:
a) why I was setting TARGETDIR to blank -- in order to get the Destination Directory blank.
and
b) that I think there's a further problem with the native engine only, appending the name of my installer to the Destination Directory when I do not want it to.
If it's not clear, let me know.
Thanks.
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 2:51 pm
by giaviv
Hi,
I am still slightly confused. You say you are installing to a number of directories, and that your user is to select a folder that is to be installed.
How is this different from TARGETDIR?
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 4:53 pm
by NickDay
Let me try and put it more simply.
By default, the Destination Directory shows an imaginary folder path, C:\Program Files\myinstallername
This is not a candidate for my installer to install into. My installer installs into a particular application's folder. There might be more than one instance of this folder, so the user must search for the correct one.
So as not to have an inappropriate path shown by default, I emptied TARGETDIR, resulting in an empty path field in the Destination Directory dialog.
Clearer?
Regards,
Nick
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 12, 2011 8:01 pm
by giaviv
Thank you Nick.
In that case, to avoid any issues, I would recommend defaulting TARGETDIR to something like C (or a different existing folder).
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Mon Aug 15, 2011 4:34 am
by NickDay
OK, thanks Aviv.
Nick
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 26, 2011 8:01 am
by NickDay
Hi Aviv,
I am finding that
a)if I
Set Variable TARGETDIR to
the Destination Directory dialog has the negative size estimate, and after the user has browsed to a folder, it returns a path in TARGETDIR which does not end in a '\'.
b) if I
Set Variable TARGETDIR to C:\
or to C:
the Destination Directory dialog, and after the user has browsed to a folder, returns a path in TARGETDIR which _does_ end in a '\'.
All my code (including additional JavaScript and a path file from another application) was written for TARGETDIR not ending in a '\'; my installer then adds it where needed.
Clearly I can rework this, but it turned out to be more work than expected and would involve a lot of retesting. Is there a way to just remove a trailing '\' (if there is one) from a path variable in MSIcode please? I looked at 'Extract Path' but that cannot, as far as I can see. Or failing that, a way to remove the final character from a string?
Best regards,
Nick
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 26, 2011 10:52 am
by giaviv
Nick,
You can remove the last character (if its a '\') in a string by appending $NEWLINE$ (or anything else) to the string and then removing the string \$NEWLINE$.
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 26, 2011 1:42 pm
by NickDay
Useful, thank you Aviv.
I suppose I could remove a final "\" only if it exists, e.g. by appending "§" or some other symbol which won't be in the path, then removing "\§" and then removing "§" (in case it got left behind, due to there being no "\" at the end of the string.
Nick
Re: Remaining Disk Space negative if TARGETDIR empty
Posted: Fri Aug 26, 2011 3:00 pm
by giaviv
Exactly!