C# Windows Service - Set service login Issue - windows

I'm building a windows service that retrieves information about different hardware, and after that it stores the information in a database, right now that part is done and im trying to install that service in different computers, and i wanted to know if the little window that pops up during the installation, called Set Service login, is possible to set some default values in those textboxes.
Thanks in advance.

If you use the Visual Studio Installer you could try this:
View the code of the processInstaller and go into InitializeComponent() methode.
There you can set the following properties for an existing local account:
this.servicename_processInstaller.Password = "xxxxx";
this.servicename_processInstaller.Username = ".\\localServiceUserAccount";
This prevent to prompt the window.

Related

Outlook form VBScript won't run

I'm designing a Outlook Contact form. None of the sample code I've tried to put in the View Code button's Script Editor does anything. The most basic example is:
Sub Item_Open()
msgbox "Hello World"
End Sub
When I click the Run This Form button, no message box or error message appears. It seems to totally ignore the VBScript. The same thing happens with every bit of sample code I've tried.
This is my first time doing any development for Office or in VBA or VBScript, so I assume I'm missing something basic, but I've watched and read a few tutorials, doing exactly what was shown and nothing works. I can design and publish a Contact form with custom fields and and basic combo boxes.
In the Trust Center I have Macro Settings set to "Notifications for all macros" and the Email Security options "Allow script in shared folders" and "Allow script in Public Folders" are both checked.
I'm designing a Contact form using Office 365 32-bit Version 1708 (Build 8431.2079 Click-to-Run) Monthly Channel on Windows 10 x64 Version 1703 Build 15063.608.
Any help would be greatly appreciated!!
Thank you!
The solution was to add some registry keys as described in the 2 articles below.
Custom form scripts now require registry settings to be added.
https://support.office.com/en-us/article/Custom-form-script-is-now-disabled-by-default-bd8ea308-733f-4728-bfcc-d7cce0120e94
https://www.slipstick.com/outlook/custom-form-security/
The registry settings mentioned there fixed my issue.
Possible causes:
VbScripting is not enabled on your machine, disabled there in Registry, especially on Windows 10. You have to enable there.
Though VbScript is enabled and you can run scripts directly from a file in a Folder like sample.vbs, script may not run on Outlook Custom Form if Outlook application has security setup in Registry Key when installed.
I faced this problem and solved after several attempts.

In VS2015 how & where do I configure the account that accesses the SharePoint Site/agile team functions?

Locally installed TFS2013, VS2015 and VS2013 using SharePoint services.
So far the development system is kind of OK, meaning I can create a collection, create a team project within a collection, add a new solution to that, run it, do a Check In and the SharePoint site shows the project code, etc. I can also create work items at the SharePoint site and from within Visual Studio.
But I'm having difficulty understanding how the user accounts are interacting. On my development workstation I logged in with a normal domain account. But I do not see work items assigned to that user name. I only see work items if they are assigned to the system Admin account.
I would have expected VS would be operating under the user account that I logged into Win10 with, but it seems to be operating as though VS is logged in as the system Admin.
Why is that? Is there a place where VS sets data that tells TFS what user name it is operating under? And, of course, I may be asking the wrong question because I don't understand the problem, but this is how it appears.
Added after initial post for clarity
This panel shot shows where the Work Items were not showing up for the user under Available Work Items. Because of the issue identified in the answer below, only work items assigned to Admin were present. But after clearing the cached credentials the work items displayed correctly according to the proper account, no longer acting as Admin.
This may due to the VS had cached your system Admin account.
The simplest way is to delete the related credentials which stored in control panel > Credential Manager> Windows Credentials
Then reopen the VS and try to connect to TFS server. It will pops up a credential window, just type your login domain account.

how to create custom installer for window application in .net

I want to create setup for my window application in .net,in which i want to asked user to input custom connection string at time of installation.how can I do it.
after digging in the matter. I have created set up project for this. now i stuck up in it.
how to move further.
any tutorial on it.
If you are using Visual Studio setup project, you can try creating a custom dialog through which you get the connection information. Perhaps this tutorial will help:
http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx
If you are using another tool, mention it in your post and I will edit my answer with some suggestions.

VS2005 Setup project - program asks for installation media when started for the first time by another user

I have a very simple VS2005 deployment project that aims to install for all users on a PC.
All the application files are written to %Program Files%\MyProg. A shortcut is created in the start menu and the startup folder. No registry settings or anything else are created. I have set
'InstallAllUsers' to true.
The created MSI runs fine and installs the software. It works without any problems when running under the user account from which it was installed.
When logging in as another user, the start menu and startup icons are present. It attempts to launch the application however an installation window pops up and states that 'the feature you are trying to use is on a network resource that is unavailable.' The installer will only proceed if pointed to the original MSI file.
Why does this happen? I want my application to be installed completely for all users when it is installed by a single user.
edit: Solution
I was getting similar event log messages as shown on this page. In my case it turned out to be as simple as ensuring that the User's Program Menu had its 'AlwaysCreate' attribute turned to false. If it was true, windows would try and recreate the folder when a new user logged in. This somehow required the invocation of the installer and thus resulted in the 'please insert the installation media' prompts.
It is actually kind of hard to say without some more information. I would recommend checking on the rights in the installed folder (seeing if only the one who installed it has rights) and also checking the file list for the directory (to make sure VS didn't automatically place some files in the user profile). Let me know what comes out from those two steps and we can try to keep digging if that didn't shed any light on it.
Keep in mind chances are this is most def not specific to Visual Studio, look at this MS support article here where the same message is coming back for office.
I know this is an old post but I thought I'd add another cause and solution in case the above didn't work for you.
There is a bug in VS Setup and Deployment Projects which results in registry values being entered into HKCU instead of HKLM irrespective of the InstallAllUsers property being set to true.
You must use Orca msi editor to change the registry root for "DesktopFolder" and "ProgramMenuFolder" from either 1 or 2 to -1. The issue cannot be resolved via VS.
http://www.qa.downappz.com/questions/vs-2010-deploys-per-user-features-during-install-which-require-access-to-install-media.html

Install Shield 2009 Premier, Uninstall doesn't close the process/gui

My application (developed using C#.net) is open now i uninstall, InstallShield gives message stating the application is already open and whether really want to close the application. Selection 'Ignore' continues uninstall. Some files and the exe of the application are not closed. How to close them by installshield on uninstall. Or there are some properties I have to set. I know adding a custom action at uninstall i can kill the process, but shouldn't installshield do it?
If your goal is to restart the open applications and not honor the "Ignore" selection, you might consider setting the "REBOOT" property to "Force". That will ask that user to restart the system, thus achieving your desired result.
If your project type is InstallScript MSI or it supports Installscript, i prefer to write code for this for example:
export prototype _Server_UnInstalling();
function _Server_UnInstalling()
STRING Application, ServiceName;
begin
//application name
Application = "Demo";
MessageBox("In _Server_UnInstalling",INFORMATION);
//Check whether application is running or not.
if ProcessRunning( Application ) then
MessageBox("Demo is running",INFORMATION);
//Close server Application
ProcessEnd(Application);
endif;
//if application is having service at the background then
ServiceName = "Demo Server";
//Uninstall the server windows services on uninstallation.
ServiceRemoveDuringUninstallation(ServiceName);
end;
The above example give the skeleton, you need to implement the logic for ProcessRunning, ProcessEnd and ServiceRemoveDuringUninstallation methods, you can refer Installshield help doc they have given documentation with along with source code
hope this helps...

Resources