Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

system variable PROGRAMFILES empty on Win2000

3 views
Skip to first unread message

JH

unread,
Sep 18, 2001, 9:30:35 PM9/18/01
to

Pardon a novice with a stupid question, but how will the IS compiler know
what MsiGetProperty() is?
Do I need to load a DLL? How can I be sure the DLL exists on the target
platform? And if it does not?

Thanks again for your help.

"Edward Clements" <kli...@compuserve.com> wrote in message
news:3ba6...@news.installshield.com...
> Although you could use something like
> InstallFolder = TARGETDISK ^ "Program Files" ^ "MyProject";
> , you can never be sure that the ProgramFilesFolder is actually called
> "Program Files".
>
> A better way would be to invoke MsiGetProperty() to het the value of
> property "ProgramFilesFolder" and append "MyProject" to the resulting
> string...
>
> Edward Clements
>
> "JH" <JHISN...@yahooNoSpam.com.au> wrote in message
> news:3ba6...@news.installshield.com...
> >
> > How would I use it?
> >
> > I have this now as PROGRAMFILES does not work:
> > STRING InstallFolder;
> > ....
> > InstallFolder = TARGETDISK ^ "\\Program Files\\" ^ "MyProject";
> >
> > This:
> > STRING InstallFolder;
> > ....
> > InstallFolder = TARGETDISK ^ ProgramFilesFolder ^ "MyProject";
> > gives compilation error: MyProj.rul (line 120): Error 1008:
> > 'ProgramFilesFolder' Syntax error. Unexpected token encountered.
> >
> > This:
> > STRING InstallFolder;
> > ....
> > InstallFolder = TARGETDISK ^ [ProgramFilesFolder] ^ "MyProject";
> > gives compilation error: MyProj.rul (line 120): Error 1008: '[' Syntax
> > error. Unexpected token encountered.
> >
> > Am I doing somthing wrong?
> >
> > Thanks
> >
> >
> > "Alexander Rodov" <aro...@earthlink.net> wrote in message
> > news:3ba40a21$1...@news.installshield.com...
> > > Obviously, I'm not the best expert in Express product, but I would
> > recommend
> > > to try the following syntax:
> > >
> > > [ProgramFilesFolder]
> > >
> > > Windows Installer service uses this System Folder Property among about
2
> > > dozen of others to allow installation developers to direct application
> > files
> > > to system locations, which may vary on different end-user's machines.
> And
> > > because InstallShield Express version 3.0 and later uses Windows
> Installer
> > > for actual data deployment, such syntax should work.
> > >
> > > Let me know if that helps,
> > > Alex Rodov
> > >
> > >
> > > "JH" <JH...@yahoo.com.au> wrote in message
> > > news:3ba1...@news.installshield.com...
> > > > Hi,
> > > >
> > > > I am using IS3 on Win2000.
> > > >
> > > > I access the PROGRAMFILES system variable and it is empty. How can I
> get
> > > the
> > > > program files directory.
> > > > Our app will be installed in many countries and I can not rely on a
> hard
> > > > coded "C:\\Program Files"
> > > >
> > > > How can I get the name of the ProgramFiles folder?
> > > >
> > > > Thanks,
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Alexander Rodov

unread,
Sep 18, 2001, 11:46:52 PM9/18/01
to
Looking back into the original question trail and this , I have to ask: what
product do you use?
InstallShield Express 3 (check-list wizard producing MSI) or InstallShield 3
(no longer supported script only based compiler)?

If you use IS 3: just call
RegDBGetKeyValueEx( HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir", nType,
svWhereProgramFilesFolderIs, nSize);

If you use IS Express 3:

You have every right to ask such question, because documentation doesn't
give you a great deal of explanation here.
InstallShield Script compiler links to MSI API via

#include "iswi.h"

-which suppose to be in the default script generated for every new .rul
file.
MSI API functions are exported in MSI.dll, which is installed on the
end-user's machine if Windows Installer engine is available there.
So if your installation package is running - MSI.dll is there and the API
calls will work.

More details on function syntax can be found in MSI help library (from
InstallShield help menu)

Let me know which product do you use and sorry for confusion,
Alex Rodov

"JH" <JHISN...@yahooNoSpam.com.au> wrote in message

news:3ba7f575$1...@news.installshield.com...

JH

unread,
Sep 19, 2001, 12:11:46 AM9/19/01
to
IS3

I am happy now and will insert and test your suggestion very very soon

Thanks

"Alexander Rodov" <aro...@earthlink.net> wrote in message

news:3ba8...@news.installshield.com...

JH

unread,
Sep 19, 2001, 1:12:14 AM9/19/01
to

This did the trick:

RegDBSetDefaultRoot( REGISTRY_BASE_LOCAL );

DBGetKeyValueEx(

"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
"ProgramFilesDir",
nType,

ProgramFilesFolder,
nSize );

Thanks


"Alexander Rodov" <aro...@earthlink.net> wrote in message news:3ba8...@news.installshield.com...

JH

unread,
Sep 19, 2001, 1:14:15 AM9/19/01
to

REGISTRY_BASE_LOCAL is the same as HKEY_LOCAL_MACHINE

"JH" <JHISN...@yahooNoSpam.com.au> wrote in message

news:3ba8...@news.installshield.com...


>
> This did the trick:
>
> RegDBSetDefaultRoot( REGISTRY_BASE_LOCAL );
>
>

0 new messages