Seeking framework or skeleton for stanard desktop applications - delphi

Every application seems to start with me taking a similar app, thowing out the "meat" of it and using the skeleton for my new project.
I don't always get all that I want from a previous project, nor do I need everything from it, but certain things keep cropping up again and again:
about box (with contact email being generated from the app name & version number direct from the project options)
splash screen (source & duration)
only allow single copy to run
prevent task switching
acccept dropped files?
minimaize to tray
hide from task manager
recent files list
that sort of thing.
I used too have such a skeleton for C++ Builder, years ago. It just read an .INI file and customized the app's behaviour accordingly.
Before I take the trouble to port it to Delphi, does anyone know of anything similar which is freely available?

You can simply create your skeleton project and add it to the repository (IDE menu Project\Add to Repository).
If you want to be able to dynamically create different projects based on some parameters (user input) you can also write a wizard using the OpenTools API.

Related

How to use the new Code Manager in the new Omniture Interface

I am confused within the new Omniture Interface for a small thing. I am trying to Generate SiteCatalyst JavaScript Code for my site.
Here is what I did.
Created Report Suites from Report Suite Manager.
and got confused how to generate code for my site.
See the old interface made it very clear to create code for my site by selecting a Report Suite as explained here.
But how to generate code by selecting a Report Suite in the new interface?
Thanks.
I don't know where the code generation is or if it even exists any longer. Have you considered using the tag manager?
It's in the Admin home under "Tag Management". You can download the site snippet from there. You will see all the code in your container at that point. You have to set variables a little differently when you use the tag manager at that point but there is plenty of documentation around it.
Code Manager
Code manager lets you download data collection code for web and mobile platforms.
Admin tools > Code Manager.
After you download the library, you must configure the code to send data to the correct tracking server and report suite.
Tag Manager
TagManager is the standard method for deployment of Adobe Marketing Cloud tags.Tag Manager 2.0 is the latest one available.
TagManager lets you:
Deploy Marketing Cloud products and Genesis integrations though a single hosted JavaScript file.
Manage tags and configuration in a secure administrative interface.
Test changes and quickly roll back to previous versions.
Use existing SiteCatalyst tags to implement TagManager without a complex deployment process.
Deploy third-party tags.
Dynamic Tag Manager
Adobe acquire Satellite and it is now DTM.It is the future of implementation.
Visit the link DTM
The old Code Manager is still there, just a bit hidden. If you go into the interface for Code Manager, just under that table is this text. It brings you to the old Code Manager:
To view the legacy code manager or download AppMeasurement libraries for BlackBerry, Windows Phone 7, or Symbian click here.
In future the world is expected to go with Tag Management and when you have time it is recommended that you implement that.
Thanks C.

How to create and immediately be able to use spritefonts during runtime?

I'd like to know if it is possible to select a typeface, font size and be able to use it right away during runtime in an XNA application.
If it isn't possible using built-in runtime methods, maybe it's easier (or better, or faster) to do it using some automation software (like autoit) to create spritefont file in the background, and be able to use it afterwards in an XNA app without restarting the app?
I'm going to use this mainly on my own computer for testing and picking fonts, so I'm okay if it requires full VS installation along with XNA framework and any other stuff.
Easy put, it can be done, but you have to use WinForms, link to tutorial in order to load spritefonts. You could do it simpler, by making a couple of spritefonts before you do anything (or create spritefonts for every font you have and add them to the content). This is so, because of how XNA handles spritefonts. As you've seen, SpriteFonts are basically an xml file. This is not how the final binaries are. The final binaries are images containing every character in the font you selected at that size. That way, the gamer doesn't have to have the font installed in order to play your game, and therefore you can do some awesome stuff with fonts and the user can't use that font (unless he rips it).
I have not yet found a tutorial for winforms and spritefonts, but I suppose that the model version needs only a little modification for it to work with spritefonts.

Different versions of IOS app

I have an app which is base in sqlite DBs and I need to create different versions of it. Each version is using different dbs, the name of them and the url to update them, and some other parameters but the code is develop to be the same in any version.
My question is how to do that keeping it simply. On android I have done several projects as library and I create a new project for each version. the new project is only a class extending from application in which I set the parameters for the name of the dbs and other strings which are defining the url etc. However in IOS I am not sure how to do that and having only one source to update for all versions.
I was reading a bit about targets but I am not sure if this is the best way, even I am not sure how to do it.
What do you recommend me? using targets? how to setup them to change the properties in the original project like the name of the database? Or do you have a better way to do that?
Every thing in the app to change the HMI or the content is in the DBs this is why I use different DBs for each version. Even I use the same DBs for the android versions.
Thanks for your help.
PS: just to clarify a bit more, the two versions has the same functions, it is just the content what is changed, and this content is in the DBs. I am not trying to have a pro and a lite version.
I think the different targets option is perfectly valid in this case, since you can decide which files go into which application. I have a similar app that shares most of the code but there are some specific resources that are specific for each application.
Just be sure that when you add new files to the project the correct target is selected, or if it's a shared resource, then all the targets are selected. You can do so in the utilities panel in XCode.

Organizing, Storing, and Keeping Track of code for reuse

Many moons ago I started storing my music as MP3’s. I downloaded like mad and just dumped them all into a folder. After collecting thousands of songs I had a big mess. After two years of organizing all music in my free time I have made it to “D” section of my library. I am starting to write code on a daily basis and I would like to keep a lot of what I do for reuse and future reference. I use Visual Studio a lot, and Eclipse sometimes, but I also do web development. Right now I am just have a folder on an external drive called Projects and inside that folder I have code I want to save broken down by its respective IDE and then the language it was developed in. This is working ok right now, but I fear after a few years it might get hard to navigate, and I don’t want another mess like my music library. What are some good ways to keep track of code and programming projects while also promoting easy navigation and future reuse?
I use a subversion repository for purpose of saving code for the future. In my repository I have the following folder structure:
\
|- Project1\
|- - Trunk\
|- - Branches\
|- - Tags\
|- Project2\
....
This is working for me and I have big and small projects that I coded on since high school in this repository. If I for instance want to port a project that I coded on Linux to Windows I create a branch that I for example call Win32-port. And when I have a 1.0 release of a project I create a tag named 1.0.
Using this method you can also set up back-up scripts and save a backup to another location. (I use a cron job and some python scripts to achieve this, but it all depends on what system the server uses.)
A book about subversion are freely available here: Link
For Mac OS X, there's the beautiful Snippets:
(source: snippetsapp.com)
Also, the new Xcode 4 will have native support for custom code snippets.
It won't really solve your organising problem, but you'll be more productive anyway by using snippet be it inside Eclipse or inside Visual Studio.
Here's a short tutorial for snippet in Eclipse : http://www.dansshorts.com/post/creating-snippets-in-eclipse
And here the explanation to create them and link them to a keyword in Visual Studio 2010 : http://www.visualstudiotutor.com/2010/02/create-snippet-visual-studio-2010/
This would take a bit more infrastructure to set up and is more for multiple people working together, but the best approach is to start thinking of Software as a Service.
For commonly used functions, wrap them as a web service with good documentation. For instance, if you have a phone validator that seems to be constantly used across projects, it would become part of your validator service.
With few exceptions, most shops don't seem to organize/share code effectively with static document type code libraries.
This would also force you to refactor the code snippets into reusable methods instead of just random code that is copied/pasted in. It also gives you a clean seperation between the public interface and private implementation.

Delphi: How do you auto-update your applications? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
The community reviewed whether to reopen this question 10 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I've been thinking of rolling my own code for enabling my Delphi application to update seamlessly as I'll be going for "release often, release early" mentality furthermore. There are various Delphi solutions (both freeware and paid) out there and I'd like to ask if you've been using any of them or simply went on with your own solutions in this area. Any comments on the auto-update topic are welcome.
What ever scheme you use, it may be handy to know that you can actually rename a running .exe file. So rename file, copy in new file works nice. And the next time someone launch the program they will launch a the new version. This is ofcourse very handy in enviroment where many users run the same .exe file, like in citrix/terminal server/network share cases.
Years ago I wrote a simple tool which is started instead of the real program, checks for updates, loads and installs them (if any are available), and finally starts the real application.
There are however problems with that approach if your program works in a properly administered environment, where users normally don't have write access to the program directories. You can no longer simply update your own program in such environments. That's why a lot of programs these days come with their own updater tool, which can be installed to run with elevated permissions, so that program updates can be applied even though only standard users do ever log on to the system.
You have to decide whether your target audience can be assumed to run on power user or administrator accounts, or whether you will have to deal with above-mentioned problems. With Vista things got considerably harder already.
With all these problems (net access over proxies, missing write permissions for installation directories, the need to update files that the updater itself is using - just to name a few) I wouldn't try again to code this on my own. Much better to check if any one of the available solutions does all you need it to.
I use the Synapse routines GetHTTP to return a specific resource, and if found then check against the local system to see if an update is required. If so then the resource tells me what page to go to launch and I throw the URL into shell execute so the users
preferred browser is displayed.
Most of the time the download is a setup program created by InnoSetup which updates the users system and database to the latest version. When a new "paid" upgrade is needed, I then send the user to a "purchase upgrade" form. My web resources are ASP pages, so I can redirect to a different resource based on the customers version number.
For the main application (our application has a server piece, and a client piece) I have a loader which will check the server to see if the version of the client file on the server is different than the version on the client...if so, it prompts the user if the user wants to update/revert. We chose to prompt the user as sometimes an accidental bug might make it into the system and the user has to downgrade/upgrade only specific machines to help troubleshoot. I maintain a database record with the minimum version required which is updated via the database patch, so if a version must be retired then the record is updated accordingly.
I created my own solution too based on Indy for downloading and http://sourceforge.net/projects/makeupdate/ for file patching.
Before that I have used and tried several commercial tools, but no one was doing exactly what I needed.
I use TmxWebUpdate. It's free, simple and gives you good control over the process. I actually own TMS Component Pack with TWebUpdate but never really found a good reason to switch.
Edit: Link updated
We rolled our own as well. Its really not too difficult.
Our process goes something like:
When the main app is launched, it checks (using funcs from the synapse library) if there's an update available (assuming its configured to check, of course).
If so, it notifies the user and askes if they want to update.
If they do, it launches an updater .exe, and closes the main app.
The updater exe downloads the new files based on the contents of a text file it retrieves, keepiing the files in memory.
When the updater is done downloading everything correctly, it then saves the downloaded files to disk, backing up any files it replaces. This way if the download gets interupted, you dont end up with half the files installed.
Finally, it launches the main app again, and closes itself.
The trick w/ Vista is that you need to have an entry in the updater program's manifest to force it to run with administrator rights.
Normally we use the third party tool. But in some situations it was not usable so I created an own solution, which was pretty standard:
Get xml (or any other format) with update info.
If newer files are published, download and install them.
I use TWebUpdate . It works ok and has a ton of interesting options, but documentation isn't so great and I did bump into a few problems - which is why I download a full installer, instead of just the files...
I will be keeping an eye on this question, btw...
We use our own solution which follows these steps:
Application connects to http resource and downloads info file (ini text file) to memory, checks version number of newest release.
If newer version available, app downloads compressed binary package to exe location.
When download is finished, user is asked to restart application.
Upon start, application checks for presence of update package
App extracts package contents (usually a new app exe, but additional resources possible as well, e.g. updated language files etc.) - for each file it renames the current/old file to a temp name first, then extracts the new file. If the process fails at any point, the temp files are restored.
When finished, app executes new exe and closes itself.
No additional updater needed, the app exe can handle it all by itself.
For the compressed package we use our own update builder.
The package contains an index of files with a file hash, destination folder (relative path to main exe) and the compressed files.
During update we compare the stored hash with the extracted file to detect corupted files.
With Vista I see two solutions to enable Standard User Accounts to actually update the applications files:
Configure your setup to change permissions of the programs installation directory. This way files in "C:\Program Files (x86)\Your Company\You App" can be modified on Accounts with limited rights.
Example code for InnoSetup would be:
[Dirs]
Name: "{app}"; Permissions: users-modify
Install files that you plan to update to the ProgramData folder instead of the user defined directory and use this directory as an override folder. If files exist in ProgramData, use those, else check in install dir.
InnoSetup code:
[Files]
Source: "C:\Your Project\YourApp.exe"; DestDir: "{commonappdata}\Company Name\App Name\";
Same as "stg" and "GuyWithDogs", I'm using TWebUpdate from TMS. Although the documentation isn't so great, Its not so difficult to learnt.
With TWebUpdate, you have some options what the protocol you use, it could be done via HTTP, FTP or network access.
For communication layer, TWebUpdate uses WinInet. In some machines, the windows / IE URL cache can be frustating, so I've added a routine to clear the auto-update server address from cache first to ensure the information gathered from the server is up-to-date.

Resources