I want to make portable the app streamWriter (http://streamwriter.org/en/). The goal of this app is to record music broadcasted by internet-radiostations. I have downloaded the file streamwriter.zip and extract it in the directory C:\streamwriter\, which contains the files streamwriter.exe and bass.dll. Afterwards I have created the file and directory layout according to the PortableApps.com Format™ Specification.
Afterwards I arrange some questions regarding the creation of a *.paf.exe file.
- During regshotting I must arrange some preferences regarding the app. Among other things I chose the portable mode of installation. These preferences are stored in a file called "streamwriter_settings.ini". Furthermore a file called "streamwriter_data.dat" was created. Both files are stored in the directory C:\streamwriter\. Additionally I must determine a folder, in which the songs can be saved. Therefore I create a folder "Downloads" within the directory C:\streamwriter\. I copy now all 4 files (streamwriter.exe, bass.dll, streamwriter_settings.ini and streamwriter_data.dat) and the folder Downloads of the directory C:\streamwriter\ in the directory streamWriterPortable\App\streamWriter\.
Is this correct? -
As the app need the file streamwriter_settings.ini, I write the following line of code in the section [Launch] of the file streamWriterPortable.ini:
- WorkingDirectory=%PAL:AppDir%\streamWriter
Is this correct?
-
The app creates a folder called "streamWriter" in the TEMP directory of my local machine. This directory must removed after the application has run. Therefore I notice the following lines of code in the file streamWriterPortable.ini:
-
[DirectoriesCleanupForce]
1=%TEMP%\streamWriter
Is this correct?
-
[DirectoriesCleanupForce]
-
As I described under Nr. 1, I copy the folder Downloads from the directory C:\streamwriter\ in the directory streamWriterPortable\App\streamWriter\. In the file streamwriter_settings.ini exist the following line of code:
- Dir=C:\streamwriter\Downloads\
Instead of saving the songs in this folder at the local machine, I want to save the songs in the folder Downloads within the directory streamWriterPortable\App\streamWriter\. Therefore I alter the file streamwriter_settings.ini as follows:
- Dir=%PAL:AppDir%\streamWriter\Downloads\
Is this correct?
- I use the PortableApps.com Application Template. Which meaning has the file AppNamePortable.ini in the directory streamWriterPortable\Other\Source?
In the meantime I figure out, that my method of resolution regarding the Nr. 4 above not works. I have installed the file streamWriterPortable_1.4.paf.exe inside the PortableApps.com Menu as well as outside the PortableApps.com Menu. In both cases I was prompted to choose a folder for saving the songs. But how can I solve this problem, which I described under Nr. 4?
-
and it will not be saved; that way it will still backup a local copy and not destroy 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
1=%TEMP%\streamWriter
And again it works.
Under consideration of the both alterations regarding Nr. 2 and 3 I think it's the best, that I now post the file streamWriterPortable_1.4.paf.exe in the Beta Forum. As I mentioned in my original post, the file streamWriterPortable_1.4.paf.exe runs successful. At the first run of the app the user must only determine the folder,where the songs can be saved. Accordingly you can better see, what potentially is to do.
All the applications data should be saved/moved to /Data once the app closes so app and data are seperated and it can be backed up by the menu.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
For a better understanding I must clarify, what exactly application data display. Main task of the app is to record music broadcasted by internet-radiostations. Therefore exist a stream-browser on the right of the main window of the app ( look at the first screenshot at http://streamwriter.org/de/inhalt/screenshots/). After I chose one radio transmitter in this browser over rightclick with the mouse, this radio transmitter will take over left-hand of the main window of the app. If I now start to record this radio transmitter, I monitor that anything was stored in the file "streamwriter_data.dat". Accordingly I assume, that this file are the application data or? Therefore I must save the file "streamwriter_data.dat" in the directory StreamWriterPortable\Data. Is this now correct?
But how can I solve the problem, which I described under Nr. 4 of my original post?
Otherwise the file streamWriterPortable_1.4.paf.exe seems to run correctly. All Icons, the Splash Screen and the help.html file work nice. And no traces stay on the local machine.
EDIT: But if I consider the original app, all files inclusive the file streamwriter_data.dat are stored in one folder.
Just use FilesMove (below):
that should do it
3. PAL has this feature where it creates a folder in TEMP (called AppNamePortableTemp) and whenever the application writes to TEMP it goes into that folder and is deleted. Thus you needn't worry about whats created in TEMP.
4. Your code will look something like this:
Please note that you will need to substitue XXX with the [section] in streamwriter_settings.ini. I would have done it, but you did not mention what it was.
Also, be sure that steamWriter creates the Downloads folder if it does not exist. If steamWriter doesn't, you will need to put an empty 'Downloads' folder in App\DefaultData so you don't run into problems
Exactly this [FileWrite1] I use without any success (XXX=Settings). And curiously I can't find the folder Downloads after I compile the package with the PortableApps.comLauncher and PortableApps.comInstaller. Now I find in the Data directory a new subfolder called settings. In this subfolder settings I find a new file named "streamWriterPortableSettings.ini" with the following content:
LastDrive=D:
EDIT: I have now read your advice to put an empty folder Downloads in App\DefaultData and I try it now again. But I must put this folder before I use the PortableApps.comLauncher and PortableApps.comInstaller or?
After I put an empty folder Downloads in App\DefaultData, I find now a folder called Downloads in the directory streamWriterPortable\Data. However I can't solve the problem regarding Nr. 4 with your advice to use [FileWrite1].
If I want to use your advice regarding [FilesMove], must I alter the appropriate file streamWriterPortable.ini before I use the PortableApps.comLauncher and PortableApps.comInstaller? And can it be, that at first I must use the code [FilesMove] together with the code [FileWrite1]. And only in this case the code [FileWrite1] works or?
I also use the PortableApps.comAppCompactor. Is it possible, that the utilization of the PortableApps.comAppCompactor create a problem?
How recommended I have done some alterations.
The file streamWriterPortable.ini appears now as follows:
The file appinfo.ini appears now as follows:
And the file streamwriter_settings.ini appears now as follows:
Only for the problem regarding Nr. 4 of my original post I can't find a solution. But the user has at the first run of the app the possibility to determine a folder, in which the songs are saved. Thereby it's recommendable to choose the folder streamWriterPortable\Data\Downloads. Accordingly no traces stay on the local machine in this case.
First, the streamwriter_settings.ini is wrong. It is read by the program and shouoldnt contain "%PAL:AppDir%". And imho, streamwriter_settings.ini should be inside /Data as it is config data. You can add
to [MoveFiles] to move it.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
I assume, that you mean to add the following line to [FilesMove]:
because the line
already is contained in the section [FilesMove].
Yes the entry "%PAL:AppDir%" in the file streamwriter_settings.ini is really wrong, which I can't solve. But how I mentioned, the user has at the first run of the app the possibility to determine a folder, in which the songs are saved. If the user for example choose the folder streamWriterPortable\Data\Downloads, then the following line appear in the file streamwriter_settings.ini:
The main problem occur in the case, if the user move to another PC. Probably the user again must determine a folder, in which the songs are saved. The reason is the change of the drive letter.
Furthermore I think it's the best to delete the complete section [FileWrite1] in the file streamwriter_settings.ini, because it isn't useful.
The changing driveletter between PCs isnt a problem as the Launcher can handle that. In your streamWriterPortable.ini, the Dir is set to always be "%PAL:DataDir%\Downloads". If the user has set something different, he has a problem. So you either have to force the user to use that exact folder or change streamWriterPortable.ini so it only replaces the drive letter.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
The problem is, that the value "%PAL:DataDir%\Downloads" from the section [FileWrite1] don't take over in the file streamwriter_settings.ini.
What about if I now start to post the file streamWriterPortable_1.4.paf.exe in the Beta Forum?
there is something wrong with either the location of streamwriter_settings.ini or with the [FileWrite1].
You can of course post it and other can have a look at it.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Surely is the reason for this problem mit high probability the section [FileWrite1].
But I have a idea. How I mentioned, it's only necessary, that the user at the first run of the app determine a folder at the flash drive, in which the songs are saved. Afterwards it's important, to find a solution for the change of the drive letter in the case, if the user moves to another PC.
What about with the following code in the section [FileWrite1]:
Are you sure that thats where the file will be?
If there are more than one settings file, they are most commonly put inside a settings folder (/Data/settings).
And it should be %PAL:DataDir%\streamwriter_settings.ini.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Of course should the code in the section [FileWrite1] be as follows:
But really exist in the directory Data a subfolder called "settings". And in this subfolder reside a file named "streamWriterPortableSettings.ini" with the following content:
Therefore I think, that the content of the [FileWrite1] above maybe the solution.
The launcher creates that file by defau to keep track of the driveletter.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Yes, that should do it. The
streamWriterPortableSettings.ini
is created by the launcher and for now contains the value used for %PAL:LastDrive%. Try it on a flashdrive and see its value changing according to the drive letter.-edit-
Zwei Doofe ein Gedanke, mal wieder.
Therefore I don't need such a [FileWrite1] and can delete it completely.
No!
You need it! Just the value that is written to streamwriter_settings.ini is based on that entry...