Archive for the ‘Windows’ Category

Geany is by far one of the best text editors I have come across that works on both Windows and Linux. It is also one of the most aesthetically pleasing editors to look at right out of the box. I do a lot of PHP scripting, and as such, it is nice to have a "beautifier" script that will automatically format my code for me so that it looks nice. Geany can also call the php executable and check your script syntax. You can achieve both of these features by installing both PHP for Windows and the PHP Beautifier PEAR addon.

Install PHP for Windows:

If you code your PHP scripts in Windows, you'll want to use syntax checking and the PHP_Beautifier script. To do so, you must install the PHP5 Windows package, which includes the main PHP binaries.

Now, select the code you want to format, right click on the selected text, and choose "Format" –> "Send Selection to" –> and pick "PHP Beautifier". The code should now be formatted using the options specified in the command line arguments above.

Creating a SFX Installation Wizard with WinRar that Can Modify Registry Settings

WinRar's "SFX options…" dialog does not contain any information or guides that help you modify registry settings after the files for your installation have been extracted. This is a hinderance, but it is extremely possible to modify registry settings by running a batch file after the installation has been completed. First, make sure the .bat file is included with the rest of your installation files that you selected before making the SFX archive. In the "Advanced SFX options" window, click on the Setup tab. Under "Run after extraction", type in just the name of the .bat file you're going to be running.

The Batch File Itself:

This template batch file checks to see if the operating system is 32-bit or 64-bit. This is an important distincting as it will affect how you setup keys for each type of operating system. 64-bit system keys are usually placed in the Wow6432Node key, so it is important to make this distinction so that your registry settings will work properly. This batch file called "Program Registry Adder 1.0" provides examples on how to add and modify registry keys depending on the operating system type.

The first parameter specifies which hive and key should be created. The /f flag forces the addition. The /v flag is the name of the key that should be created. The /t flag specifies what type of Registry key should be created. The example uses REG_SZ, which is just a string. The possible types are:

Using both a self extracting installation wizard and a batch file for registry key settings makes for the perfect free to use professional looking installation script. You can always run the batch file silently by removing all pause statements in the script.

When creating a self extracting installation wizard using WinRar, you may want to create a shortcut to your program on the user's desktop. Typically, these parameters are specified in the "SFX options…" dialog. In the "Advanced SFX options", click on the "Advanced" tab. Here, you'll see a section called "Shortcuts". If you create a shortcut using the "Add shortcut…" button, WinRAR will typically leave out an important undocumented feature.

If you create a desktop shortcut using the "Add shortcut…" button, make sure you set the "Destination folder" to just a slash "\" (no quotes) or the shortcut on the desktop will have the following properties:

Target: "D:\Install Directory\YourProgram.exe"
Start in:

Notice, there is no "Start in:" path. To fix this, you need to add a "\" to the desktop shortcut parameters manually like so:

D, yourProgramsName.exe, \, "Shortcut Description", "Shortcut name",

Or, make sure you place a "\" (no quotes) for the "Destination folder" in the add shortcut helper.

This problem only affects desktop shortcuts and can be fixed by adding a "\" to the parameters for each desktop shortcut after the program's name.

Open Game Panel (OGP) is a free, open source game server panel. OGP allows server administrators to manage multiple game servers and assign users to those servers. These users are then allowed to login and manage their rented game servers. Users can stop, start, restart, and edit command line parameters for their servers. FTP management is also included in the Linux version. OGP does have a Windows version, however, it is difficult to setup. However, this guide will walk you through everything you need to know.

General Information and Notes

Some links used in this guide will only work from your local server.

I installed ZPanelX and OGP on a Windows 7 server, and yes, they are working.

OGP is short for Open Game Panel, if you didn't already know.

Step 1: Download and Install Prerequisites

Open Game Panel works in conjunction with a web hosting control panel and requires web server software. To make this guide as simple as possible, it is recommended to install the ZPanelX package, which includes everything you'll need to run Open Game Panel. Download both the Core and Stack ZPanelX packages here:

Install the Server Stack version first, and then run the Core version to setup your web panel and login information. It's really as simple as running the installation executables and following the installation prompts.

After ZPanelX has been installed, download the SVN version of OGP from here: http://hldstart.svn.sourceforge.net/viewvc/hldstart/trunk/. From the SVN page, just click on "Download GNU tarball". This will download a compacted zipped file which can be open using 7-Zip or WinRar. Extract the files. From the extraction directory, copy the upload folder to the C:\zpanel\panel directory. Rename the folder to opengamepanel.

Open up the php.ini file located in C:\zpanel\bin\php and change the following line:

display_errors = Off

To:

display_errors = On

Keep the php.ini file open, as we'll need to change another setting after installing PEAR, a module required by OGP to run.

Step 2: Installing PEAR For Windows

To install the PHP PEAR module for Windows, save this file containing the patched PEAR PHP installation script, and extract it to the C:\zpanel\panel directory. Run the PEAR installation by following this URL from your LOCAL server: http://localhost/go-pear.php. Read the prompt and go to the next page. On the installation page under the Configuration section, you'll need to make the following changes:

For "1. Installation prefix ($prefix)", use the path of:

C:\zpanel\bin\php\pear

Keep the rest of the settings set to their default value. Click Install. After PEAR has been successfully installed, go back to your php.ini file and find your include path:

Change:

; include_path = ".;C:\php\includes;"

To:

include_path = ".;C:\zpanel\bin\php\pear\PEAR;"

Save your PHP.ini file. Now, before your changes will take effect, you must restart the Apache daemon. Do this by going to Start –> All Programs –> ZPanel –> Management –> Apache Monitor

When the Apache monitor loads, click Stop, and then click Start.

Step 3: Creating Database and Users:

Login to ZPanel using your login and password that was created during ZPanelX installation. Under Database Management, click on MySQL Database. Create a new database with any name. Once the database has been created, go back to the main Admin page. Under Database Management, click on MySQL Users. Assign a user to the database you just created… this will be the login and the user's password will be generated after assigning the user to a database. Save the database name, login, and password, as you will need these values when installing OGP.

Install the OGP Windows Agent program. Run the agent_stop.bat file in the OGP installation directory after the installation has finished to stop OGP. To run OGP without using the service account, simply use these agent start and stop scripts instead.

Start the agent. Login to OGP, create a server, use the encryption key you just created, and for the username use your Windows username.

The server should be added successfully and show up as online. You can now setup and administrate game servers on your Windows server!

I've been running my main machines on Windows XP x64 for several years, and I am a .NET developer. There came a day when I needed .NET 4.0 for my development projects. After installing .NET 4.0 in Windows XP x64 SP2, I noticed a slow bootup despite the fact that I have a solid state drive. Windows would always boot up and freeze for about a minute before the network LAN and Wireless LAN computer icons appeared in the system tray. At first, I never realized the problem was caused directly from the install of .NET 4.0. For over a year I tried troubleshooting the problem. I noticed that I had this problem on all of my XP machines after installing .NET 4.0. I suspected video drivers, LAN drivers, wireless LAN drivers, and even my BIOS. Nothing fixed this issue. After further searching, I finally found a thread describing the same issues I was having. Save yourself the read, and just run this batch file I wrote after installing .NET 4.0 on ANY Windows XP x64 or x86 machine:

I have not experienced the slow boot issue on Windows Vista or Windows 7 after installing .NET 4.0. Thus, please run this batch file on your XP machines after .NET 4.0. If you don't, I hope you enjoy headaches.

Despite what Microsoft claims, I've seen some computers not revert back to their last set num lock setting when Windows was last shut down. Granted, this could be caused by Enterprise configurations.Here's a simple batch file that should keep Num Lock always ON when a user logs in. It may or may not need to be run with administrator privileges based on your enterprise configuration. I've had several users complain about the fact that Num Lock is turned off when they turn on their computers in the morning. As a result, this batch file allows you to enable the setting that keeps num lock enabled after a user logs in with minimal effort. I'm still under the impression that this is more work than the user simply pressing the num lock key to turn it back on.