John's Computer Journal: vista
Showing posts with label vista. Show all posts
Showing posts with label vista. Show all posts

Thursday, May 3, 2007

Clearlooks for Windows GTK+

The Clearlooks theme engine for GTK+ is a great alternative to the wimp theme engine. Because Vista introduces some bugs into the wimp engine, I've taken a look at compiling Clearlooks for use on Windows. MinGW compiles Clearlook's code without any problems on Vista.

For those who don't have the GTK+ toolchain setup I've attached the binary compilation of Clearlooks 0.6.2 for windows. I've packed the binaries into an Installer that should put everything into the correct location. If the installer doesn't work like it should, just unzip the executable and copy all the files within the Files directory into the root of the GTK 2.0 directory.

The Installer creates a backup of the current GTK+ theme configuration, so upon uninstalling the Clearlooks theme GTK+ will switch back to the previous configuration. Any GTK+ applications will have to be restarted before theme changes take place.

Download

References

Tuesday, May 1, 2007

Single Processor Mode in Vista

Vista doesn't use boot.ini to configure the boot loader. Instead it uses bcdedit.exe and msconfig.exe To create a new boot entry that loads Vista in single processor mode follow the following steps:

  1. Open cmd in administrator mode (press the windows key, type cmd, and press ctrl+shift+enter)
  2. Type the command: bcdedit /copy {current} /d "Vista Single Processor" The command will return something like the following, but with a different number between the {}'s The entry was successfully copied to {68602c25-5097-11da-99de-000802209f1b}.
  3. Type the following command and replace the portion that says ID with the number returned from the previous command. bcdedit /displayorder {ID} /addlast
  4. Now type msconfig
  5. Click the boot tab and check mark the Make all boot settings permanent box.
  6. Select the Vista Single Processor entry and the click advanced options button.
  7. Put a check next to Number of processors, select 1, and then put a check next to Detect HAL. Click OK.
  8. Set the Timeout value to something like 3 secs. Click OK, click Yes, and Restart.
  9. Select the Vista Single Processor Entry from the boot menu to boot Vista with one processor.
References

VLC on Vista

Vista's Aero interface messes with VLC's ability to playback some videos on default settings. The video settings must be changed manually to DirectX video output. In VLC:

  1. Select the Settings -> Preferences menu.
  2. Expand the Video Section (click the plus next to video) and select Output modules
  3. Check the Advanced options box and select DirectX video output.
  4. Click Save and restart VLC.
Unfortunately, setting the output to DirectX will cause windows to disable Aero when playing back videos. The Windows GDI setting will avoid this, but won't have the hardware acceleration of DirectX and can't select menu items on DVDs. DirectX 3D will work for DVDs, but only for certain videos.

References

Wednesday, April 25, 2007

MinGW and mSYS on Vista

MinGW doesn't work well on Vista without adding some extra environment variables. The following environment variables will allow gcc to find its sub programs, the standard include paths and libraries when linking.

MinGW Variables

GCC_EXEC_PREFIX=c:\mingw
PATH=%GCC_EXEC_PREFIX%\libexec\gcc\mingw32\3.4.2;%PATH%
PATH=c:\mingw\bin;%PATH%
MinGW must be installed to the root directory. For example c:\tools\mingw will not work. It must be c:\mingw.

mSYS Variables

PATH=c:\msys\1.0\bin;%PATH%
HOME=%HOMEPATH%
Vista will force a User Access Control (UAC) message to elevate privileges whenever it detects a program with the words setup, install, or patch in the filename or description. However when a program is run from the command line, Vista will not bring up the (UAC) message and just deny access to the executable. To get around the problem make sure to work with elevated privileges when performing a make install or when patching.

Refferences

Sunday, April 22, 2007

sudo for Vista's User Access Control (UAC)

By setting a SHELLEXECUTEINFO's lpVerb value to "runas" a call to ShellExecuteEx will cause the UAC to elevate the run privileges for a given program. The concept can be implemented into a simple program so that a behavior similar to linux's sudo command can be achieved.

Methods of Implementation

The ShellExecuteEx runas method can be implemented by any method that interfaces with the ShellExecuteEx API. The code provided below for download was written using c++. Within a visual basic script the ShellExecute function of the Shell.Application object can be used to invoke runas.

The command line tool `runas' provides similar functionality. However, the `runas' command is different enough that it can be confusing for users to use in Vista. The obvious difference is the command line vs. the graphical interface. Other differences include the inability for the `runas' command to accept empty passwords and recognize when the user already has elevated permissions.

Issues

Directory Change

When the runas verb is passed to ShellExecuteEx the current directory always gets reset to the %systemroot%/system32 directory. The lpDirectory variable has no effect. Therefore, to maintain the correct directory the directory must become part of the command that ShellExecuteEx runs. By wrapping the command to execute using runas within a %comspec% /c cd /d "directory" start /d "directory" call the correct directory is used when the command or file is executed.

User Context

The ShellExecuteEx runas method suffers from the same user context problems that haunt the command line tool `runas'. The context switch can cause problems for programs that access user specific areas and variables such as the username, home directory, desktop, or registry. For example, if an installation program is launched through `runas' by a non-administrative user an option such as "create desktop shortcut for local user" will create the shortcut on the administrators desktop NOT the desktop of the user that initialized the installation through the runas command.

There is a workaround to the context problem that would require the user to provide an administrative username and password and then provide their own non-administrative username and password. Aaron Margosis introduced the concept in his "Non-Admin" WebLog where he introduced his MakeMeAdmin batch script.

Download

References

TweakUAC has a package of functions to handle UAC events. The VistaTools.cxx package clued me into setting the lpVerb to "runas".

Tuesday, April 3, 2007

MyHD on Vista

I am currently running a MyHD 100 card on Windows Vista without disabling the security features in Vista. The following is a list of steps and hints that can serve as a guide and reference.

Installation

  1. Download the latest driver. The latest driver can be found either on Digital Connection or on the AVS Forum.
  2. Install the driver using Windows XP compatibility mode.
  3. Set both the MyIRC and MyHD executables to run in Windows XP compatibility mode and as an administrator.

Annoyances

  • The MyIRC executable must be explicitly allowed to run every time the computer starts.
  • Time Shifting must be manually enabled. See the issue below.

Issues

  1. Do not enable "Full Time Shift." Enabling the Full Time Shift function will cause either an error message or a massive memory leak.
  2. The drivers (1.66.1) I used do not properly support hibernate and suspend in Vista. Make sure to not use suspend or hibernate or the system will blue screen and reboot. Disable suspend in the power control panel.
  3. Some functionality may not work as expected. It has been noted both on Digital Connection's MyHD FAQ and the MyHD FAQ on the AVS Forum that the DVD player and other functionality is disabled by the myHD program with Dual-Processor (DP)/HyperThreading (HT) (no matter what OS). The FAQ on the AVS Forum suggests disabling a processor/core or hyperthreading from either the bios or Windows boot.ini. Simply setting the process affinity will not work because the MyHD program specifically checks if the processor is DP or HT enabled. It may be possible to hack the binary to disable the DP and HT checking.