New locations of 'data' folders (since 2010-06, for Vista and Windows 7)

Data folders in Windows 7 and Vista - Help or Hindrance ?

When Microsoft came up with Vista (and all later versions of Windows), they decided to change the location of folders (directories) where users should put "their" data. In contrast to earlier windows version (like XP) the 'Documents and Settings' folder ('Dokumente und Einstellungen' in german) has gone. Instead, there should be folder for each user in the root of drive C.
Much worse, any directory in the former 'Programs' folder, where Spectrum Lab and including ALL its subfolders used to be installed by default, doesn't have write permission for users without an admin account. There may be good reasons to do this, but the ugly consequence is that you cannot have 'all in one place' anymore, and that you cannot make a copy of an installed Spectrum Lab, including all of its (possibly modified) configurations by copying for example C:\Programs\HamRadioSoftware\SpectumLab (including all subdirectories) anymore !

To be prepared for other 'nice surprises' which Microsoft may come up with in future, the following pinciple will be used now (since 2010-06) :

- The PROGRAM (Spectrum Lab) and all files which do NOT need to be modified by anyone (i.e. which don't require write-access after installation) will still be installed in the default "install" directory, commonly called the 'Programs' folder, depending on your windows version and local language :

C:\Programme\Spectrum Lab (at least on a German PC with windows 98, ME, 2000, and XP)
C:\Program Files\Spectrum Lab (on a PC with english language and windows 98 ... XP)
C:\Programmi\Spectrum Lab (on an Italian PC, etc etc ... you'll get the picture)

As already mentioned, files which do NOT need to be modified after installation will still be installed in a subdirectory in the same path. This applies to the help system (in html), the folder for some SDR-specific drivers, but not to most other directories created by the installer.

- All other files and folders, which will possibly be modified during the runtime of the program, must be placed somewhere else (thanks to Vista, outside the 'Programs' folder mentioned above). Because by the time of this writing, the author neither used Vista nor Windows 7, so it the 'best place' for those 'data files' was unknown. You can specify the location of those files / folders during the installation process. Depending on your system, this may be some crappy location like...

C:\Documents and Settings\All Users\Application Data\SpecLab (on some XP machine)
C:\Dokumente und Einstellungen\Mein Name\Anwendungsdaten\SpecLab (on another XP machine)
C:\ProgramData\Spectrum (just a guess, another OS, maybe just an 'alias' for just another stupid 'shell folder'..)
C:\Users\Public\Spectrum (another guess, most likely this is just an alias of the above but not a 'real' directory)

Since Spectrum Lab V2.76 (July 2010), the Spectrum Lab installer uses an NSIS (Nullsoft Scriptable Installer) scipt which will ask you for the location of the data folder. If you (like SL's author) don't want to use the obfuscated default folder (from window's %APPDATA% path), you may (!) override the default setting ("Dokumente und Einstellungen" or whatever crappy path) by something shorter like C:\Spectrum - which was actually the default used by the older installer.

Caution:
If you override the 'data' folder for Spectrum Lab by a better, and easier-to-find path, make sure it has write permission later, when running the program with only user access rights (which you should do, for the sake of security). The installer itself doesn't check if a self defined path will have write permission later.
Note:
For whatever strange reason, Microsoft decided to hide (!) the application's data folders ("%APPDATA%") in the 'windows explorer' (or whatever they call their default file manager these days). So don't be surprised if you cannot find 'your' files easily... suggestion: Use a decent file manager (not the explorer-thingy), or at least, turn the stupid hiding of the 'application data' folder off. And, on that occasion, also turn off the triple-stupid option to 'hide file extensions of known file types' (so you can see that "funny_picture.jpg" in your 'downloads' folder is in fact "funny_picture.jpg.exe").

Ok then.. but how does Spectrum Lab know where its "data files" are now, since we cannot place those files in its own directory (under "Programs") ? The installer generates a simple text file in the program's "executable" folder (no problem, because the installer must have write permission for this folder anyway). This file, called  "data_file_paths.txt" is used to pass the location of the 'data file' directory from the installer (i.e. InstallSpecLab.exe) to the installed application (here: SpecLab.exe) . See details in the next chapter. For simplicity, and to avoid a lengthy explanation of 'Windows Shell Folders' here (*), let's assume all 'data files' used by Spectrum Lab will be copied into C:\Spectrum by the installer, as a real directory, not some 'virtualized' crap.


(*) To read a deterrent story about 'where an application should place its data files', see
     http://doughennig.blogspot.com/2007/01/finding-paths-for-special-folders.html .

How Spectrum Lab finds 'its' data folders (since 2010-07)

As explained above, there may be different places where Vista (etc) wants you to put your data - depending on the windows version. The SpecLab INSTALLER asks you for the location of these 'data files'. Instead of fiddling around with the windows registry, the INSTALLER then places a short text file in the 'installation folder' (same folder as SpecLab.exe) called data_file_paths.txt (click on the link to view it, if you read this document after installation).

Because the executable (SpecLab.exe) will be installed under 'Program Files' (or similar) it can only read that file, because it will usually be run with a user account and this doesn't have write permission to anything located in the 'Programs Files' folder.

The file data_file_paths.txt must be located in the same directory as SpecLab.exe. If necessary, you can modify it with a text editor.. but remember: On a Vista- or Windows 7 machine, you will need an administrator account for this. Spectrum Lab itself will not be able to modify the file, because it shall run with a user account, under any windows version.

Sample data_file_paths file (as created by the Spectrum Lab installer) :
; data_file_paths.txt: Specifies the location of all 'data files' for Spectrum Lab.
; This file will be written by the Spectrum Lab installer,
; using the full path for the WRITEABLE data files specified by the end user.
; You can modify the path to the data files by editing this file.
; More details in the help system; see html\data_folders.htm .
data_files = C:\Dokumente und Einstellungen\Mein Name\Anwendungsdaten\SpecLab

When starting, SL will try to read this file. It will use the path found there. Otherwise (as in older versions), it will use the path to the executable (aka "install directory") for the data files.

In addition to data_file_paths.txt, the location of the configuration file(s) also be modified through the command line (details here ). Parsing of the command line parameters takes place after reading data_file_paths.txt, so the command line argument override the settings in data_file_paths.txt .

How you can find Spectrum Lab's data folders (since 2010-07)

Due to the problems with hidden folders mentioned in a previous chapter, the data folder may be difficult to find - especially if SL was installed a long time ago. To locate the base path, open the 'About' box in Spectrum Lab (main menu, 'Help' ... 'About'). The lower part of the 'About' box will show something like the following:

Exec: C:\Programme\Spectrum Lab\SpecLab.exe

Data: C:\Dokumente und Einstellungen\My Username\Anwendungsdaten\SpecLab

Note: The path names can be marked copied from this info box.

The 'Exec' field shows the full directory and filename of the executable. In this directory, you will also find the uninstaller, the file data_file_paths.txt, the help system (subfolder 'html'), and possibly a few DLLs which may be required to run Spectrum Lab on your system.

See also: Spectrum Lab's main index