I'm About to Give Up on InnoScript - Part 2

Started by Randem, December 22, 2007, 10:34:58 AM

Previous topic - Next topic

Tom Buggy

I think I may have answered my own question regards the overwriting of the skeleton files -- a .exe or batch file run WITHIN SETUP.  True?  
 
If so, what about app access to the files post-install?  Obviously, the databases get updated during use of the program.

Tom Buggy

Good News / Bad News / Other News.  I was able to use {commonappdata}GHMDATA and Environ(APPDATA) on my XP test system to get the separated data files in C:Documents and SettingsAll UsersApplication DataGHMDATA.  That's the Good News.
 
The Bad News is that in the startup of my app I am trying to replace the skeleton database files installed in Setup with converted database files (ala what current users will do).  I'm using a File System Object and able to establish the folder where the files reside.  However, the files don't get copied.  In testing within the VB IDE on the XP development computer I get Permission Denied on the file copying.  I notice that all the folders from Documents and Settings and below are checked as Read Only.  When I tried to uncheck Read Only a bunch of processing took place and the box became unchecked.  But, when I went back to Properties the box was checked again.  I tried setting Modify permissions on the files in Inno Setup but that had no effect (as I suspected given the Read-only status of the folders).  What's strange (to me) is that Setup can write the skeleton files, or is that because Setup runs as Administrator.  Is there a way around this?
 
The Other News is that I had to use the uninsnveruninstall flag on the data files in Inno Setup to prevent them from being uninstalled when the application is uninstalled.  I've since modified my Template to keep the {commonappdata} and uninsneveruninstall things permanent in the script.

Randem

The change:
 
 
New: When uninstalling your application all empty installation folders will be removed from the installed location and the APPDATA location. Of course you can change this behavior by removing or changing the [UnInstallDelete] and [Dirs] entries.

Randem

Yes, Environ will work on Win2K.
 
The unistall method has changed I must update the history. The data files will no longer be deleted. the folder will only be deleted if it is empty.

Tom Buggy

I understand your point of view but, as you are surely awarae by now, I'm inclined to simpler things.  Besides, you worry me with qualifications like MOST Windows systems and do ALMOST everything for you.  I'll take a closer look at your posted methods tomorrow.  In the meantime, will Environ work on Win2000?
 
I've installed Build 10 and reviewed the Release Notes, including the following:
 
New: When uninstalling your application all folders and files of the application will be removed from the installed location and the APPDATA location.
 
As you know, I don't want (in fact, can't have) the data files removed.  Can I overcome what I think I'm reading with respect to data files via Template or Inno Setup?  (BTW, if what I'm interpreting is true, why would you remove the data files/databases that the application uses and will likely continue to use?  In the least there should be an option.)

Randem

Windows 2000 does have APPDATA just like XP.

Randem

Same thing. If you do it the correct way you won't need to redo it and you will save yourself possible headaches. The routines I posted do almost everything for you. Why not use them?

Tom Buggy

Right now I have exactly three users who aren't using XP or Vista (with just one on Vista).  One of the three is on 98, another on 95, and the third on 2000.  The 98 and 95 users are both in the snowbelt and are planning to get new computers over the winter.  Plus, I doubt that any new users will be on systems prior to XP.
 
So, except for the possibility of Win2000, it looks like Environ(APPDATA) can be used.  As for future Windows versions, I'm inclined to address them when they arrive and I'll still have the methods you posted to be used if necessary.
 
Therefore, what about Win2000?

Randem

When you update your Beta version make sure you check the Release History for some insight into what the latest Beta Builds have in them.
 
We are at Build 10 now...

Randem

No, the messages were moved to a new thread for speed (See I'm About to give up on InnoScript - Part 2).  
 
If you used APPDATA and it is missing, as on systems prior to XP you wont get a location to place the data. If you used the methods like I posted in the project you will be fine under most Windows systems including future versions.

Tom Buggy

Looks like the thread got truncated a bit - the last few posts are missing.  Anyway, I've taken just a quick look at the VB project you sent and will take a deeper look tomorrow.  At first glance it seems (to me) to be a bit complicated way to get the application data folder. Plus, does it support beyond Win2000?
 
I've looked at the Inno Setup doc regards {commonappdata}.  It says (using Ctrl-C and Ctrl-V):
 
The user constants below refer to the currently logged in user's profile. common constants refer to the All Users profile.  Except where otherwise noted, shell folder constants work on all versions of Windows that Inno Setup supports, including Windows 95 and NT 4.0.
 
and:
 
{userappdata} & {commonappdata}  
The path to the Application Data folder.
 
Given the above it would appear to a systems neophyte like myself that Environ(APPDATA) might be used.  Why can't it?


Tom Buggy

Unfortunately, I've had an interruption.  I'll look at your project later tonight or in the morning.  You have me feeling optinistic.

Randem

Don't use the Environ statement anymore. Did you see the project I posted?
 
The rest is true...

Tom Buggy

In Inno Setup use the replaceable item {commonappdata} for All Users.
 
Is this a breakthrough?  Does it mean that if I substitute in Inno Setup {commonappdata} for {app} under [Files] for the data files I can then use Environ(APPDATA) to get the path to where the data files are installed?  If so, should I also add a folder name (Ex. {commonappdata}GHMDATA) to establish a subfolder for the files?