How would I set the default installation directory that the user is prompted for to be {commonappdata}myappname for Windows Vista and Windows 7 but set it to c:program filesmyappname for all other (earlier) OS's ?
The default installation for Windows 7 and Vista can be set by adding the template named Legacy. It will automatically determine if you are running Vista / Windows 7 or the prior OS's and set the default installation folder accordingly. The {commonappdata} is not the default installation folder though. If you want to change the installation folder manually you can go to Settings->Parameters from the top menu list to change the DefaultDirName parameter to what you want it to be.
I am not sure how to add a template. I am using innosetup 5.3.7 and istool 5.3.1.
Sorry, That was for InnoScript... In Inno Setup just add/change the directive DefaultDirName={commonappdata}\{YOURAPPNAME} in the [Setup] section to change the default installation folder name.
Currently I have ....
DefaultDirName={commonappdata}{#MyAppName}
This is a hard-coded constant I thought. So if I install to XP for example, it will not install to c:program files.
Not sure I am following what you want me to do.
In Inno Setup you would need to write code to accomplish the task of changing the DefaultDirName depending on the OS. In InnoScript this has been done for you and all you would need to do is to add the legacy template. Are you familiar with writing code for Inno Setup?
okey dokey then. I just purchased innoscript. I am all for not reinventing the wheel. Can you expedite the purchase and send me the registration code sooner rather than later? Thanks.
Since I have innosetup and istool already installed is there anything special I have to do before I install innoscript?
No, there is nothing special to install InnoScript.
Also {commonappdata} should not be the default installation folder.
BTW: Has your application been updated for a Limited User Account? You cannot have read-write files in the default {systemdrive}Program Files folder.
Yes I know. I did think that the commonappdata folder was a good place to install legacy apps that need to write to the application directory? I have a vb6 app that uses an Access 2000 database. I also write to a local ini file and create log files in the application directory. Where would you suggest I install the app if not in the commonappdata folder?
The legacy template will take care of that. You should install legacy applications in the \Users\Public\YOURCOMPANYNAME\YOURAPPNAME\ folder