Shop OBEX P1 Docs P2 Docs Learn Events
Parallax software in "portable" versions — Parallax Forums

Parallax software in "portable" versions

RDL2004RDL2004 Posts: 2,554
edited 2013-08-15 13:33 in General Discussion
I tried running both the Propeller Tool and SimpleIDE from a flash drive (copied from an installation on a different computer). It seems to work okay, however in both cases Registry keys are created under Windows 7. This happens automatically without the UAC being invoked (no user permission needed). I assume this is done by some kind of system API call or something similar that is initiated by the program when it is first run, but maybe Windows does it. I don't know, does anyone else have any idea?

Personally, I'm of the opinion that the Windows Registry ranks very high on the list of things that "seemed like a good idea at the time..." and should be used only by Windows itself. Many, many programs these days can run in "portable mode" (nothing written to the Windows Registry) this provides a number of useful benefits.

There is nothing special in these Registry keys, just basic program settings which could easily be stored in config file in the program folder instead of the Registry. Is there anyway this could be changed? Maybe in a separate "Lite" version?

Comments

  • Don MDon M Posts: 1,652
    edited 2013-08-12 09:00
    This would be a great idea.
  • kwinnkwinn Posts: 8,697
    edited 2013-08-12 20:28
    I agree 100% with RDL2004 and Don. Windows programs using .exe and .ini files worked just fine. The only thing the registry seems to have added is more complexity, more opportunities for malware, and longer boot times.
  • jazzedjazzed Posts: 11,803
    edited 2013-08-12 20:46
    Propeller-GCC must be in the user's path. That is a registry setting.
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-08-13 05:14
    Propeller-GCC must be in the user's path.

    Path variables can be set manually, this doesn't prevent all the more trivial and mundane settings from being stored in a separate config file instead of cluttering up the Registry, which is the real point here.

    My experience is that even after being "uninstalled" most software leaves behind many useless entries in the Registry. Given enough time this leads to Registry bloat and slowing down of a Windows system. This is probably not the intention of the developers, it may be a defect in the Windows or third party install/uninstaller process.

    Yesterday, after manually deleting all the ParallaxInc entries from my experiments in "portable mode", I installed the Propeller Tool using the normal procedure. I ran the tool one time and then uninstalled it via the Control Panel. Here's what I found:

    attachment.php?attachmentid=103305&d=1376395095

    This particular system is my old Core2Duo machine which bit the dust last fall and I am in the process of resurrecting it for use as a "work" computer. I've reinstalled Windows 7 on it four times in the last couple of weeks trying to fix some minor issues* and in the process I've messed around a lot with Services and such, so there's a remote possibility I may have done something which caused this. I did another Windows install last night and I now have a solid restore point with all the default settings, so I will try this again to see if I get the same results. I need to do a full system backup first.




    * Does anybody know why a PCI wireless Ethernet card would cause the HDD light to flicker?
    1024 x 576 - 176K
  • jazzedjazzed Posts: 11,803
    edited 2013-08-13 07:35
    RDL2004 wrote: »
    Path variables can be set manually ...

    This is true. Command-line Propeller-GCC has a batch file that sets the path before opening the big black command window which provides a proper environment context.

    If I could set the environment variable for multiple programs from within SimpleIDE, a "portable" version might be possible (with a .ini file).

    The priority of such an enhancement needs to be determined.
  • GadgetmanGadgetman Posts: 2,436
    edited 2013-08-14 10:00
    Just a point...

    There's a reason why programs aren't supposed to use a .ini file in the program directory;
    The program runs with the user's right, and he shouldn't need to have write access to that folder!
    In fact, the user shouldn't have write access to ANY folder with executable files.

    This is for security reasons... Without write access, trojans and other cr*p that the user accidentally starts won't have write access to other files, so it can't 'burrow' into other files.

    Any program can by default add or edit keys in the Current_user part of Registry, but not in the 'Global' areas, to stop cr@p from installing itself as a service or to run in the background.
    (Most browser hijackers for example can be removed by restarting the PC, logging in as an admin user and removing the offending file from the 'Run' node in the user's part of the Registry)
  • Heater.Heater. Posts: 21,230
    edited 2013-08-14 11:20
    Gadgetman,
    In fact, the user shouldn't have write access to ANY folder with executable files.
    What a load of twonk.

    When I write a program on a computer I expect to be able to compile and execute it. It's somewhere in my home space and it's executable and I have to write to it and execute it. I'll also need any config and data files it needs in my home space. It's impossible work otherwise.

    Same if I down load source for, say, SimpleIDE to compile and check out. Same if I download a pre-compiled binary of SimpleIDE. There is no need to make any OS global changes, like registry entries, to do any of that.

    Now perhaps that binary is a trojan. Oh well it can now trash my home space. Easily fixable. It cannot install itself a permanent feature of my OS running in the background or such.
  • jazzedjazzed Posts: 11,803
    edited 2013-08-14 11:47
    Normal users are not allowed to write anything to "installed" Program Files or any super-user protected places.
  • Heater.Heater. Posts: 21,230
    edited 2013-08-14 11:53
    Yes, but I thought we were talking "portable" versions. As in fetch it and run it with no installation steps. So no reason not to have .ini or any other data files the program needs in the same directory.
  • GadgetmanGadgetman Posts: 2,436
    edited 2013-08-14 12:04
    Any file that needs to be changed should stay the H! away from the folder that the exeutable is in. A subfolder is the only acceptable solution.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-08-14 12:09
    RDL2004 wrote:
    Does anybody know why a PCI wireless Ethernet card would cause the HDD light to flicker?
    Maybe it's logging all of your connections. :)

    -Phil
  • jazzedjazzed Posts: 11,803
    edited 2013-08-14 12:36
    Heater. wrote: »
    Yes, but I thought we were talking "portable" versions. As in fetch it and run it with no installation steps. So no reason not to have .ini or any other data files the program needs in the same directory.
    Yes, but it should be clear to everyone by now (I hope) that creating a portable version is different from creating an installed version.

    Of course anything that needs persistent settings must use some kind of storage.
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-08-14 13:10
    Yes, portable apps are typically run from a USB drive, hence the name "portable". I run mine from a separate folder, not from "Program Files", but I also have a copy of that folder on a USB drive. Programs installed on Windows 7 are supposed go into the Program Files folder and do not write there. They normally use C:\Users\UserName\AppData\ (on Windows 7 anyway) to store their config stuff. Firefox for instance saves almost nothing in HKEY_CURRENT_USER\Software\Mozilla in the Registry, it's in AppData.

    I don't think Program Files (X86) has the write restrictions because that's where Steam installs and it saves all kinds of stuff there. I also have a game that's in its own folder directly under C:/ and it has no trouble saving games there. Which makes you wonder what the point is after all.
    Maybe it's logging all of your connections.

    Using an Ethernet cable doesn't cause the HDD light to flicker. I tried 3 different PCI wireless cards and they all did it. I'm going to try a USB wireless adapter next.
  • Heater.Heater. Posts: 21,230
    edited 2013-08-14 15:06
    Gadgetman,
    Any file that needs to be changed should stay the H! away from the folder that the exeutable is in.
    I must be a bit dense today. Can you explain why that might be? I would certainly inconvenience a lot of things I do regularly. Of course this is true if the "portable" program you want to use happens to be on a CDROM or other read only media.
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-08-14 18:33
    I reinstalled Windows 7 from scratch (for the fifth time) on the Core2Duo. I didn't mess with any of the default settings or services. I then ran regedit and exported the Registry to a text file. I opened the file in Notepad++ and counted all the instances of Parallax and ParallaxInc. The count was zero for both as I expected.

    Next I installed the Propeller Tool, everything except the FTDI driver and no file associations. I dumped the Registry to a text file again (without actually running the Propeller Tool) and the results of the count were:

    Parallax =161
    ParallaxInc = 0

    Hmm...

    Started and shutdown the Propeller Tool one time and repeated the Registry dump and count. Results this time were:

    Parallax = 167
    ParallaxInc = 3

    As best as I can figure out all, or nearly all, of the Parallax entries are from the install tool. Keeping track of what was written to the hard drive I guess, so it would know what to remove if the Propeller Tool was uninstalled. The actual keys used by the Propeller Tool are the ParallaxInc keys. They show up in three places and there's almost 100 sub-keys. As far as I could see they're just simple basic settings.

    After getting that information, I uninstalled the Propeller Tool, restarted the computer and did the dump and count again. This time the results were:

    Parallax = 8
    ParallaxInc = 3

    Okay...

    I checked and yep, all the ParallaxInc sections along with all the sub-keys are still there. I wonder why they don't get removed when the application is uninstalled?

    I didn't bother to look and see where the 8 remaining Parallax entries were, but I think know what they were because - the Parallax entry on the Start menu was still there and the Parallax folder in "Program Files" was still there. There were no files inside, but the main folder and all sub-folder were still present.

    Why did the uninstall not remove them I wonder.

    I ran the System Restore and put things back the way they were yesterday.

    At this point, my conclusions are that the uninstall process didn't do anything that I couldn't do better by just hitting the delete key. And I can do that without writing and then removing over 150 entries in the Registry.

    I know if I just put a copy of the Parallax folder on the computer and run the Tool without bothering to install it, it will automatically make the ParallaxInc entries in the Registry (and only those) and hopefully that's all it needs to work.

    That will be my next experiment.
  • GadgetmanGadgetman Posts: 2,436
    edited 2013-08-15 00:22
    Heater. wrote: »
    Gadgetman,I must be a bit dense today. Can you explain why that might be? I would certainly inconvenience a lot of things I do regularly. Of course this is true if the "portable" program you want to use happens to be on a CDROM or other read only media.

    It's just that it makes it a much cleaner setup. Yuo can set file permission on an entire folder just as easy as on a single file. And if all files that may be changed are in a single folder...
    Most people, if they get a file permission error(and know how to set permissions) will just open the entire folder for 'full access' no matter what files are in it.
    Not exactly an Einstein moment if that is the folder with the main executable.
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-08-15 13:33
    Success.

    attachment.php?attachmentid=103360&d=1376598070

    I installed the FTDI drivers, then I copied the Parallax Inc folders into "Program Files" (had to be done as administrator), and it looks like it's running just fine without ever being "installed". If the Prop Tool could be modified to not save its settings in the Registry and just use a local xml file or something, it should be possible to run it from a flash drive just about anywhere. Of course you wouldn't be able to actually program a Propeller unless the computer you were using already had the FTDI drivers installed.

    One thing I noticed is that some of the Registry keys specify a full path to certain locations and I'm wondering what would happen to those if I had put the Parallax Inc folders somewhere else besides in "Program Files".

    For example:
    .
    Value 18
      Name:            LibraryPaths
      Type:            REG_SZ
      Data:            C:\Program Files\Parallax Inc\Propeller Tool v1.3.2\Library\
    
    .
    
    1024 x 576 - 175K
Sign In or Register to comment.