Page 1 of 1

Install to required folder depending on OS version

Posted: Mon Oct 17, 2005 11:10 am
by Guest
Hi

I am currently evaluating InstallAware, and one feature I need to use is not apparent. This may be because I have not been able to read all supplied help so I am sorry if this is a dumb question.

I have a set of files; I need to install them to different folders depending on OS version. E.g. On windows 98 I need install into drive:\\<winsysdir>\\ and on Windows 2000 or above, the same file needs to be installed into drive:\\<winsysdir>\\DriversIs this possible – and can you show an example on how to achieve this? Outcome of this post will effect whether I buy a copy :-)

Posted: Mon Oct 17, 2005 1:39 pm
by sinan
This is actually a very good question, and don't hesitate to post any and all questions you may have, no matter how stupid they may seem, or whether or not you intend to purchase :)

You need to use some scripting to achieve this effect. First, capture the OS information into a variable using the Get System Information command. Then, based on the value of this variable, you can define a new variable for the target folder using the Set Variable command. For instance:

Code: Select all

if TestVar is True then
  Set Variable TARGETFOLDER to $WINSYSDIR$
else
  Set Variable TARGETFOLDER to $WINSYSDIR$\\Drivers
end


The above is pseudo-code, but you get the idea :D

Finally, using Install Files, just specify the target folder using this newly defined variable, say Install Files to $TARGETFOLDER$.

Posted: Mon Oct 17, 2005 2:41 pm
by Guest
Thank you for your quick reply. Sorry if I sounded like I was threatening over where or not I would buy; I just did not want to waste your time!

Your reply part answers my question; I had sort of guessed that I would need to script the install; however I am still missing one important part.

The interface is not intuitive on how to load the required files and how to recover them. Any help please?

Posted: Mon Oct 17, 2005 4:07 pm
by sinan
What do you mean by "load the required files and recover them" exactly? Please be specific on where you are stuck so we can help you better :)

Posted: Mon Oct 17, 2005 4:33 pm
by Guest
Ok,

The software needs to know where to pick up the source files from to be able to package them into the installer. How 'put them into the installer' when the destination folder is not known, and how do I extract them.

As I have already said, the interface is not intuitive on how to do this, it seems to be geared round 'source from here 'destination here'

Hoppe this is clearer for you :-)

Posted: Mon Oct 17, 2005 4:39 pm
by sinan
OK, so what you want to do is use the Install Files command;

Source Files Field: Click Browse and visually locate the file(s) to install; you may use wildcards

Target Folder Field: Usually something like $TARGETDIR$, in our example it will be $WINSYSDIR$ or $WINSYSDIR$\\drivers

Hope that helps! You basically want to have two Install Files commands for the files you want to install.

Posted: Tue Oct 18, 2005 6:14 am
by Guest
Ok,

Thank-you very much for your help. Got there in the end!

It would be nice if you could add files via the Visual GUI, i.e. right click Target Folder and then choose an option 'Create new traget folder', give it a variable name and then you can load files. This would make the whole process one step eaiser!

Thanks once again, and just pruchasing studio version :-)

Posted: Tue Oct 18, 2005 7:16 am
by sinan
Yes, that's true. The thing you can do in the visual view is selecting files (multiple ones if you wish) after having added them; and then updating their target folder in a single pass by right-clicking and choosing Edit.