LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Installer for Windows 7 from XP

I'm sure a lot of people have run into this issue -- I am trying to build a Windows 7 compatable installer on Windows XP. The compatability I need is just to place my ini files in a directory that is NOT Program Files\<Application Name> because on Windows 7 files in this directory are not writable. They should be going somewhere under User Data but I can't put them there when building the installer because I am building it on XP.

 

Solutions that have been thought of are

 

-Just install to C rather than C:\Program Files. Then I can write to the files in C:\<Application Name>

 

-Install to Program Files\<App Name> and on startup of the program check the machinie I'm on and if it's Windows 7, copy the ini file from Program Files\<App dir> to the user data directory

 

-Give my code to someone with a windows 7 machine to build it (stupid option)

 

-Make users set admin privledges so they can write to the files (another stupid option -- entirely defeats the purpose of the rules Windows is now implementing)

 

Has anyone else worked around this issue, and if so how did you do it?

0 Kudos
Message 1 of 7
(3,267 Views)

Default data dir = C:\CCIData Smiley Wink  set the folder properties to whatever you need with a .Bat


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(3,265 Views)

Try using the [Public Application Data] directory:
Windows XP
C:\Documents and Settings\All Users\Application Data\
Windows 7
C:\Program Data\

Example Installer method
-Create Installer
-Go to Category: Destinations.
-Within [Public App Data], create a subfolder <project name>.  
-Go to Category: Source Files
-Select your configuration files (from the Project Files View) and add them to [Public App Data]\<project name>.  
-Finish other Installer configurations
-Build Installer and deploy.

The installer will place the config files into the directory \[Public Application Data\<project name>\ (creating it if need be), and you can point to that directory using the Get System Directory VI.

Within your program, use the Get System Directory VI (from File Constants palette) to point to this directory.  

In one program I have, I check for the directory \[Public App Data]\<project name>\ and corresponding config files; if they are not there, then I create the subfolder \<project name>\ and any other default files or folders.  Use the above Installer method to place configuration files that can't be created programmatically.

The link below has some useful info (and better explained) on this issue as well:
http://zone.ni.com/devzone/cda/tut/p/id/7005

Hope this helps!
Regards,
Daniel

Message 3 of 7
(3,181 Views)

Thanks, this is exactly what I ended up doing. Only problem is so many exisiting apps had the configuration in C:\Program Files\ <Program Name> on XP that it takes lots of re-writing. Glad Microsoft finally decided to inforce their rules.........ugh.

0 Kudos
Message 4 of 7
(3,173 Views)

I feel your pain ...  in fact I remember that pain! Smiley Wink

 

Glad to hear you have a working solution!

 

0 Kudos
Message 5 of 7
(3,162 Views)

I am following what was posted above and the installer installs everything in the right place, but my application within the installer keeps looking for C:\documents and settings\administrator\local settings\application data\ when everything is installed at C:\documents and settings\all users\application data\.

 

Any idea why this is happening or how I can fix it?  Thanks.

0 Kudos
Message 6 of 7
(3,035 Views)

Hah, you know what! I just figure it out.  I had the wrong system directory type selected on the Get System Directory VI... didn't even notice that.  Thanks though!

 

With the Get System Directory VI make sure you have Public App Data selected for the directory type and not User App Data.

0 Kudos
Message 7 of 7
(3,032 Views)