Creating and making an shortcut appear on Start Menu - c#

I'm maintain an Pocket PC 2003/CF.NET application and would like to
automagically create an shortcut on Start Menu on first run.
So far, so good. I created the LNK file and put it on Start Menu folder,
but Windows only shows 7 app slots on it - I had to manually uncheck an
app to make it appear on Start.
How to automate that?

Wow this takes me back
When you install using an inf file via cab install adding more than 7 shortcuts to the start menu they will end up in the \Start Menu\Programs.
I don't think you can automate removing items from someone's startmenu bar as this could be malicious.

Related

How to add Icon to add or remove programmers when publishing a WPF applcation

I am Writing a WPF Application with visual sutdio 2013.
In the properites of the application I specified an icon.
I also added it to the folder (jpg and ico)
when I publish my applicaion as offline (launchable from start menu)
I have 2 questions
1) the icon appear in the folder and when I run the application but does not appear in the add or remove programs, how can I add it to add remove programs?
2) how can I specify where I want the folder to be installed? also is there a way to add a dialog to ask the user?
Thanks for all the answers

C# Alternative window's shell not displaying

I am writing a very simple alternative shell to replace explorer.exe the shell is run on Windows 10 Enterprise. I set up the C# Windows Form application to display as the alternative shell in the registry and pointed it to the \share folder.
When Windows boots and logs me in I get a black empty screen. If I run explorer.exe through the task manager - I does not load the Shell but the folder explorer. So Windows recognises that an alternative shell is being used.
So why is the form not displaying?
There is no code to show as the form is simply a form with a single label on it saying running.
Easily solved when I thought about it.
Shells cannot be started from a Shared network folder - the executable must be on a local drive.

How to get Xamarin Studio C# output within the IDE?

I recently started experimenting with Xamarin and Mono C# on my Mac. I am used to working on Windows with Visual Studio so I find it cumbersome when every time I run my console application, a new terminal window and mono compiler terminal open up. And I have to manually close them. Is there anyway to get the output of my programs from a window or pane inside the IDE ? Or is there anyway to set it up so only one terminal window shows up ?
If you open the Project Options there is a Run on external console check box in the Run - General category which controls this behaviour. If you uncheck this option when you run a console application the output will be shown in an Application Output window inside Xamarin Studio and no external console window will be opened.
For anyone else arriving at this question who can't locate 'Project Options', the item is found in a drop down menu under the Project Tab (located at the top of the screen on the app's main nav bar). When a solution/file is loaded, the item is listed with your project's actual name, ex: 'MyProject Options' or 'MyProject&Options' (–it does not literally read 'Project Options').

Programmatically changing assembly (application) name?

I have a WPF project running on Windows 7 Embedded & Windows 8 Pro. In the taskbar when the application is pinned and I right-click the application icon, the C# project name pops up. Is there a way to change this name programmatically?
I want to load the application name from an .ini file at run-time.
UPDATE:
I have prior to asking this question searched and reviewed the other question that asks a similar, but different question on how to change the file name after compilation. I do not want to change the file name, just the name on the taskbar after right-clicking the application icon that is pinned.
I would say there is no "easy" way to do it, necessarily.
I would assume you have to run some sort of script or use Powershell.
Using method ?, create or rename a shortcut to your .exe with the name you want to show up in the pinned application.
Start the application using the shortcut. (At this point the "application name" in the task bar is the name of the shortcut used to launch your .exe)
Pin the application.
Shortcut is added to AppData, and the application will remain the same name of the shortcut.
Here was my pinned task bar info: C:\Users\me\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
You could also probably modify the registry and add the shortcut straight to the folder listed above, then reload explorer.exe, but you have to worry about user permissions and what not. Either way, this should give you something to roll with.

Optional User's Desktop shortcut issue

(Using VS 2010 with a Visual Studio Installer project.)
I have added a 'Checkboxes(A)' dialog to the 'User Interface' under the 'Start | Welcome' dialog and set a checkbox with the property set to "DESKTOPICON". The option is being displayed.
In the 'File System' the 'User's Desktop' has the condition property set to DESKTOPICON=1.
When I run the install on my VM the option appears to be ignored and the desktop shortcut under the User's Desktop list is always installed.
I looked at these similar posts but it does not seem to work for the desktop icon?
How do I specify Visual Studion Installer Conditions?
Visual Studio Deployment Project Optional Desktop Shortcut
Is it normal for the User's Desktop to ignore it's condition property or am I doing something wrong?
Visual Studio setup projects create only shortcuts to installed files. This type of shortcuts are linked to their target and share the same component.
Since in Windows Installer you can condition only components and features, you cannot condition a shortcut directly.
A common approach is to write a custom action which removes the shortcut. You can then condition the action instead of the actual shortcut or its folder.
Well, I know it's been a long time but today I faced exactly the same issue as mentioned. I wanted to try creating a windows installer in VS 2013 using "Installer Projects" extension thing and wanted to make a checkbox with condition whether create a desktop shortcut or not.
Like above, shortcut under User's Desktop was always installed.
After wasting almost 3 hours I found a workaround on the old Microsoft Connect feedback post: (which apparently was already dead for some time)
Ok I got this to work by adding the main file twice to the folder (the
file you are creating your shortcut to). I tie the shortcut to one of
the files and on that file I set the condition to CHECKBOXA1=1 so it
will only create that file and the shortcut if they check the the
"Create Shortcut" box. For the other file I set the condition to
CHECKBOXA1<>1 so it will create it when the check box is anything but
1 (not checked).
originally posted by Chancea on 7/1/2010
I tried to do it that way - it works as intended. Not really convenient whatsoever (can mix up the same looking names etc). For a really, really simple installer thing (which I needed) with an only additional feature, adding shortcut to desktop, it might be fine however.
Nevertheless I still think it only proves that this is just a port of an Installer Project from earlier versions of Visual Studio, now added by an extension.
The idea may be good and useful I think, but I wish they fixed just some of the Windows Installer project in VS issues and lack of features.
Like I said, it would be great option for people (... like me) who want to publish some pretty small and lightweight apps, and needs only some basic features from the installer like (optional desktop shortcut, adding to startup, installing some additional files etc etc).
Well, I guess the conclusion is that I'd just have to start learning WiX or try out the InstallShield
After another 2 1/2 years in VS2019: The problem remains that the shortcut created in the "User's Desktop" folder can not handle the condition imposed by the checkbox. Thus a somewhat simpler (but also not "clean") solution would be not to duplicate the exe (e.g. myApp.exe) like in Skippers solution (it did not work for me), but to create an additional myApp.bat file doing nothing but starting the myApp.exe.
The simplification consists in the fact that only a condition on the myApp.bat file is necessary, and no one on the myApp.exe file.
The following steps worked here:
Create a myApp.bat file doing nothing but starting myApp.exe, i.e. containing the single line "myApp.exe" (without the quotes). Of course, commandline parameters would be possible if necessary.
Put myApp.bat into the "Application Folder" of your installer project.
Set the condition on myApp.bat to CHECKBOXA1=1, meaning it is created only in case of the CHECKBOXA1 having been set.
In the "User's Desktop" folder of the installer project, create a shortcut to myApp.bat (Context menu "Create new shortcut"), give it the icon of your app ("Icon" property). Do not specify a condition. Here in my case (VS2019 on Win10) this resulted in a NOP action when the myApp.bat was not created (checkbox unchecked), and properly created the link on the desktop when myApp.bat was present (checkbox checked).
For this shortcut, you might wish to set the "ShowCmd" property to vsdscMinimized, to avoid the large command line window of the bat file.

Categories