You are here

Question regarding the registry

16 posts / 0 new
Last post
tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
Question regarding the registry

Adopted a program called AppName generated the registry key HKEY_CURRENT_USER\Software\AppName. This registry key may be exported to the file appname.reg.

In the file AppnamePortable.ini I create the following 2 sections:

[Activate]
Registry=true

[RegistryKeys]
appname=HKCU\Software\AppName

Is it necessary for me before the first start of the portable program, that I insert an empty file named appname.reg in the folder Data\settings?
Or is it sufficient to use the above described code, which then automatically creates the appropriate registry key HKEY_CURRENT_USER\Software\AppName and the file appname.reg in the folder Data\settings?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Not necessary

The Launcher takes care of it.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
more transparency

I think it is useful for understanding the operation of the launcher, the individual steps explain in more detail. The procedure is somewhat laborious and consists of the steps described below. For the following explanations will be assumed, that the launcher uses the code, which I mentioned in my original message.

The operations will be carried out as follow:

  1. The launcher saves an empty file "appname.reg" in the folder Data\settings.
  2. If there exist a local installation of the same program on the PC, then a backup of the registry key "HKCU\Software\AppName" with "resident" program settings in a log file is created, which I call "backup.reg".
  3. Delete the registry key "HKCU\Software\AppName". This serves to initialize the working environment of the portable program.
  4. Import the file "appname.reg" from the folder Data\settings into the registry.
  5. Startup and use of portable program. By changing the settings of the program the registry key "HKCU\Software\AppName" may also be changed.
  6. Closure of the portable program.
  7. Export the registry key "HKCU\Software\Appname" to the file "appname.reg" and save this file in the folder Data\settings.
  8. Delete the registry key "HKCU\Software\Appname".
  9. Restore "resident" program settings previously saved in the file "backup.reg".

I hope that these instructions are complete and correct. Please supplement or correct these instructions, if them contain some failures.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Huh?

How is it laborious? You set the stuff in an INI and the launcher does all the work for you. You only need the .REG file to exist ahead of time in DefaultData if you need to have a set of settings different from what the app will create for itself.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
instructions performed by launcher completely automated

Of course it's clear for me, that the launcher perform all of these above described operations completely automated. The reason for the listing of these instructions is rather that in this way a background knowledge should be imparted to the often too abstract explanations to make statements in the PortableApps.com Launcher documentation more transparent.

However, me one point is still not entirely clear. In Nr. 1 of my instruction I described, that the launcher saves the empty registry key "HKCU\Software\AppName" in the folder Data\settings. Suppose that we are in a more complex situation, which is one where there is another copy of the same program "resident" on the same computer. Accordingly already exist a registry key "HKCU\Software\AppName". My question is now, if it's possible, that the launcher creates another registry key "HKCU\Software\AppName" (which doesn't have any entries) without the usage of the registry and saves this key in the file appname.reg within the folder Data\settings?

Aluísio A. S. G.
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
No #1

#1 is not done.

Previously known as kAlug.

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Nope

What you're asking doesn't quite work. It's about as obvious as it can get. If a user runs a local copy of the app while the portable one is running, it becomes another copy of the portable one. If the local one is already running, the portable one will not run. I don't quite get why you're overcomplicating this.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
revision of the instructions

Due to some changes I have revised the above instructions. Of course the launcher will perform all of these below described operations completely automated. Only the described operation in No. 4 must be performed manually by the user.

The launcher use the following both sections in the file "AppnamePortable.ini":

[Activate]
Registry=true

[RegistryKeys]
appname=HKCU\Software\AppName

Here now the revised instructions:

  1. If the launcher detect a local installation of the same program on the PC, then a backup of the registry key "HKCU\Software\AppName" with "resident" program settings in a log file is created, which I call "backup.reg".
  2. Delete the registry key "HKCU\Software\AppName". This serves to initialize the working environment of the portable program.
  3. The launcher creates a registry key "HKCU\Software\AppName" with no entries in the registry.
  4. If at the first start of the program the user wish to use individual settings, then he must save an appropriate file "appname_predifined.reg" in the folder DefaultData.
  5. Startup and use of the portable program. By changing the settings of the program the registry key "HKCU\Software\AppName" may also be changed.
  6. Closure of the portable program.
  7. Export the registry key "HKCU\Software\Appname" to the file "appname.reg" and save this file in the folder Data\settings.
  8. Delete the registry key "HKCU\Software\Appname".
  9. Restore "resident" program settings previously saved in the file "backup.reg".
  10. Delete the file "backup.reg".
John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Developer

#4 should read developer/publisher. If they want a different set of default settings than the app itself creates on first run when the registry is entry, they should put it in DefaultData. Note that this is usually not necessary.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
user=developer/publisher

Thank you for this correction to my unclear wording "user" in No. 4. I had already thought about this ambiguity itself.

I also assume, that it's necessary to store the file "appname_predefined.reg" in the folder DefaultData\settings (instead of the folder DefaultData). Then only in this case the file "appname_predefined.reg" will be pasted in the folder Data\settings. Is this assumption correct so far?

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Correct

That is correct.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
3. portable app

I have now create my 3. portable app. But I need a permission of the developer, because the app is freeware but not open source. For this reason I sent him an appropriate email. Should I wait with the publication in the Beta forum until I get permission from the developer?

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 2 days 4 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
Yes and no

If you're able to setup the installer.ini to download the files, instead of including them, you can set it up as an online installer while you wait for permission.

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
no answer to my email

But what should I do, if I don't get an answer to my email? Can I interpret this as a permission?

John T. Haller
John T. Haller's picture
Offline
Last seen: 2 hours 36 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
No

The way copyright law works is that you're not allowed to do things with other people's works without their express consent. Open source licenses give this consent. Freeware licenses generally do not (unless they specifically allow modification, repackaging, etc). To repackage and redistribute without permission is illegal. There are other portable software sites that operate illegally in this fashion. We only operate 100% legally here.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 6 years 1 month ago
Developer
Joined: 2010-10-17 08:11
readme.txt

In the readme.txt I found the following content:

Permission is granted to anyone to use this software for personal
use and redistribute it freely, subject to the following
restrictions:

1. The origin of this software must not be misrepresented,
you must not claim that you wrote the original software.

2. This notice may not be removed or altered from any source
distribution.

3. If you decide you like this software and decide to continue
using it, Send me an Email and tell me how you like it.

4. Use of XXX for other than personal use requires
a purchased "Site License" for XXX.

Here is mentioned, that I can freely redistribute it. But my portable version is surely also a repackaged product and in this respect I can't find any statement to this point. Therefore I think it's the best, that I wait on this permission.

Log in or register to post comments