franky13
Posts: 8
Joined: Thu Jan 01, 2009 6:17 pm

Create Shortcut to console application with layout/colors/..

First: Happy new year to everyone!

Now my question: I'm a new customer to AI for some days and I already have my setup (almost) perfectly up and running - so far, I am very happy with AI.

Just one issue/taksk is driving me nuts: In my setup I create a shortcut to an external file, powershell.exe to be detailed. After installation this shortcut successfully opens a Windows PowerShell console window, but that one uses the default shell window layout (black background, white font color, windows and buffer size etc.).

What I really try to accomplish is creating a shortcut that uses the default colors and layout of PowerShell console windows, so these shell windows can easily be distinguished from cmd.exe windows. Is there any way in AI for modifying the shortcut properties (if the shortcut point to a console application)?

Thank you for any help.

Regards Frank
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Create Shortcut to console application with layout/colors/..

Hi Frank,

I'm afraid I don't know much about PowerShell. You need to see what commands for changing the foreground/background colors are supported by Windows PowerShell and set them as arguments for the shortcut.

For example to start cmd.exe with foreground/background colors to Blue/Green use following command line: cmd.exe /T:12. On how to do this programmatic please see:
http://nibuthomas.wordpress.com/2008/08 ... plication/

Hope this helps.

Best Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
franky13
Posts: 8
Joined: Thu Jan 01, 2009 6:17 pm

Re: Create Shortcut to console application with layout/colors/..

Hi Gigi,

thank you for your answer - unfortunately that doesn't help me, because powershell.exe doesn't have any command line arguments I could pass that modifies the window's colors etc. (see http://technet.microsoft.com/en-us/libr ... 86620.aspx).

But the problem is in fact not powershell related - it could be reproduced with cmd.exe, too.

Do the following:
- create a shortcut to cmd.exe
- go to the properties of the shortcut. You will see tabs like "layout", "colors" etc. (which a shortcut to a non-console application doesn't have)
- modify the color properties etc.

Starting cmd.exe through this shortcut will open the cmd-window with the parameters specified without the arguments being modified at all.

What I like to do, is creating a shortcut to a console application with custom colors in Advanced Installer. Can this be done?

Thanks for any further input.
Regards Frank
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Create Shortcut to console application with layout/colors/..

Hi,
- create a shortcut to cmd.exe
- go to the properties of the shortcut. You will see tabs like "layout", "colors" etc. (which a shortcut to a non-console application doesn't have)
- modify the color properties etc.
If afraid you cannot control those shortcut option tabs from Advanced Installer (those tabs are proprietary depending on the shortcut target). As I suggested in my previous post you can control the colors of cmd.exe using a command line argument. Place this argument in Advanced Installer shortcut "Arguments" field. But I cannot figure out if the layout or fonts can be controlled also.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”