PDA

View Full Version : ini files not being created or update



NewsArchive
04-15-2017, 02:42 AM
Hi All,

I have done an install and doing some testing on my new app. But running
into a problem updating or creating ini files.
For some reason I am not getting write access to the folder. Using
setupbuilder for the install. Also have the settings in the
global to save the ini in the application folder and it is not being
created.


Thanks,
Frank Krause

NewsArchive
04-15-2017, 02:42 AM
Maybe a silly question but do you actually have rights to the folder?

Andre Labuschagne

NewsArchive
04-15-2017, 02:42 AM
Hi Andre,

That is the problem. See Jeff's reply.

Thanks,
Frank

NewsArchive
04-15-2017, 02:43 AM
If your application is stored under Program Files, then you can't
write to that folder.

Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.

Grammar troll's, are the worse.

NewsArchive
04-15-2017, 02:43 AM
Hi Jeff,

Thanks for the information i did not know that installing the program into
the ProgramFiles(x86) folder that would not give me write access.
So installing the program and data files into the ProgramFiles(x86) folder
is old school?

Is there any articles on this?

Thanks,
Frank

NewsArchive
04-15-2017, 02:43 AM
> Thanks for the information i did not know that installing the program into
> the ProgramFiles(x86) folder that would not give me write access.
> So installing the program and data files into the ProgramFiles(x86) folder
> is old school?
>
> Is there any articles on this?

See my reply in the other newsgroup where you posted Frank, but YES you
should be putting the program under Program Files.

The data and/or INI files should go into a CSIDL location and we have a
writeup on selecting one here:

http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm

I hope that helps!


:-)

Charles



--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ImageEx, ProScan, ProImage, ProPath and other
Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-15-2017, 02:45 AM
Hi Charles,

> http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm

In addition to that here are links to two articles I wrote years ago
about data under vista, which are still valid as far as I can tell:

http://www.icetips.com/blog_wp/2008/10/31/title/
http://www.icetips.com/blog_wp/2008/11/11/run-programs-elevated-on-vista/

There is also an free old utility on Icetips, called SpecialFolders,
which shows the CSIDL values and the corresponding folders:

https://www.icetips.com/downloadfile.php?FileID=71

It's completely free to download:)

Best regards,


--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
04-15-2017, 02:45 AM
Hi Charles,

> http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm

Sorry didn't read all the way to the bottom - thanks for the link:)

Best regards,


--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
04-15-2017, 02:46 AM
>> http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm
>
> Sorry didn't read all the way to the bottom - thanks for the link:)

I'm always glad to share links to good information!


:-)

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ImageEx, ProScan, ProImage, ProPath and other
Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-15-2017, 02:46 AM
Hi Frank,

> For some reason I am not getting write access to the folder.

The following is a VERY brief description of how to make an application
"UAC-aware"

http://www.lindersoft.com/forums/showthread.php?46710-Installation-software&p=83976#post83976

Do not write per-user information or user-writable information to the
"Program Files" folder tree.

BTW, you'll have the same problem on XP (and earlier) when running under a
Limited User account.

Friedrich

NewsArchive
04-15-2017, 02:53 AM
> I have done an install and doing some testing on my new app. But running
> into a problem updating or creating ini files.
> For some reason I am not getting write access to the folder. Using
> setupbuilder for the install. Also have the settings in the
> global to save the ini in the application folder and it is not being
> created.

Hi Frank,

First off, if you are installing under Program Files, then that is a "READ
ONLY" folder, so no writing can take place there.

If you are installing to another folder, then be careful if you are running
the program at the end of the install.

Your installer is "elevated", so unless you are using the SetupBuilder
option to run the program "non-elevated", then the files are being created
by "Frank the Administrator".

Then the next time you run the program Windows will run it non-elevated and
you are running it as "Frank the User".

Use something like "Everything" to search your PC and see if the files were
created at all.

They may be virtualized (especially if you are trying to write to a
location under Program Files).

Of course the best way to handle INI files (other than being sure that your
program is properly manifested and code-signed) is to use our ProPath
templates.

Then your INI files can live in the folders where Windows wants them to
live and the entire process is seamless and easy for you.

http://www.clarionproseries.com/html/propath.html

Good luck on your project!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ImageEx, ProScan, ProImage, ProPath and other
Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-15-2017, 02:54 AM
Hi Charles,

Thanks I am using SetupBuilder for my install. I placed the same question
on the setupbuilder thread and Jeff replied telling me that
ProgramFiles has only read only.

BTW I went to your site and would like to buy the ProPath but you stated
that a new version will be out soon.
question how soon?

Thanks for you help,
Frank

NewsArchive
04-15-2017, 02:55 AM
Hi Charles,

Ignore the question about the latest version I see it now on the website.

Thanks,
Frank

NewsArchive
04-15-2017, 02:55 AM
> Ignore the question about the latest version I see it now on the website.

Hi Frank,

Thanks for the order!

Feel free to drop me a line if you prefer as to what you are trying to do
(and the reason you were creating the INI file in SetupBuilder).

To piggyback the answer to your question in the SetupBuilder forums, YES
you should be installing your program under the Program Files folder.

It is the Windows standard and will always be so from all indicators that
Microsoft gives us.

It also protects your program from casual alteration by viruses or malware.
Having the entire folder array being read only means that ONLY an elevated
program (or an elevated installer can put anything in there. So it takes a
conscious YES from the user to allow changes there.

The data (and INI files) should go into one of the CSIDL locations. You
can see a writeup about it in the ProPath docs, or online here:

http://www.clarionproseries.com/propathhelp/index.html?selectingacsidl.htm

Once you have that decided, then basically those locations get a couple of
folder levels added (if you hold to the Microsoft standard).

So your data or INI files wind up in a path like:

CSIDL_LOCATION\YourCompanyName\YourProgramName

The reason you would use that instead of just:

CSIDL_LOCATION\YourProgramName

is that it allows files created by your company (whatever program the
customer has) to be organized under the company folder.

You can also choose to split the main data files from the INI files (and
even some setup type files).

Doing this would typically put your main data under the "My Documents"
(which is CSIDL_PERSONAL) and the INI and/or special setup files under
one of the other CSIDL locations such as CSIDL_APPDATA.


While some developers are paranoid about making the changes, it can
actually be a good thing to use CSIDL_PERSONAL (for single user programs)
as that folder is typically backed up by default for most backup programs.


Of course if you need to share data from one PC to the next, you will
probably want to put it under one of the "COMMON" CSIDL folders such as
CSIDL_COMMOM_APPDATA.

Do note that if you do this then you will want to create that folder in
SetupBuilder and use the ACL commands in SetupBuilder to grant access to
other users. Otherwise they will not be able to see the data.


BTW - ProPath gives you a "First Run" capability where you can create
things, run procedures, etc. the "First" time your program runs.

It also has a "First Deploy" technology that allows you to do things like
put demo data (or lookup files, other resources, etc.) in the CSIDL
location where the data is being stored (or any ProPath defined file
location).


If you still need to do something in SetupBuilder, then all you need to do
is use SetupBuilder to create the folder structure in the same CSIDL
location as you use in ProPath, then write the INI file there.

Just be sure that you use the "Run NON-elevated" option in SetupBuilder if
you allow the users to run the program at the end of the install.

As I mentioned before, the CSIDL location for "Frank the Administrator" is
NOT the same as the one for "Frank the User".

So if your program starts elevated (from your SetupBuilder installer which
should be running elevated), then all will work fine for that session. But
the next time the program starts Windows will run it non-elevated and your
data or INI files will appear to be "missing" because the program will be
looking in the wrong place for them.

The good news is that ProPath makes it easy to direct both the data and the
INI files to the proper CSIDL location (and again - they can be in
different places).

It can even handle situations where you have shared data on a server (or
network share somewhere) and you still want each user to have their own INI
file (or settings files) stored in a location on their individual PC.

It is a "set it and forget it" type solution, so once you decide what you
want it will simply "work" and you can go on with the business of
programming the real work that your software does.

:-)

Again thanks for the order and do let us know if we can be of assistance.

Charles




--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ImageEx, ProScan, ProImage, ProPath and other
Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
04-15-2017, 02:55 AM
Hi Charles,

Thanks for all the information have some work to do. Also I appreciate all
the hard work you and other 3rd party vendors do in order to make our lives
a bit easier.

Thanks again for the info.
Frank

NewsArchive
04-15-2017, 02:56 AM
> Thanks for all the information have some work to do. Also I appreciate all
> the hard work you and other 3rd party vendors do in order to make our lives
> a bit easier.
>
> Thanks again for the info.

You're welcome Frank.

Thanks again for your business!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ImageEx, ProScan, ProImage, ProPath and other
Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------