Visual Studio 2012, VS 2012 Command Prompt, VS 2010 Command Prompt, and a C++ console application compiled in 64-bit with VS 2012 are all reading an out of date instance of various registry keys. Each application (i.e. VS 2012, the command prompts, and the compiled app) all seem to have their own version of this out of date registry. Below are the symptoms I'm seeing and my various attempts to fix it.
I've both added new registry entries and updated the data in existing ones and all appear updated in HKLM\Software\ viewing them with RegEdit and using 'reg query ' in a normal console window.
Using the VS Command Prompt I perform the same query and get registry entries prior to my updates. If I open up a VS 2012 command prompt and perform edits using command line arguments the registry for that VS 2012 command prompt is now different than the registry read by the VS 2010 command prompt. It is also different from the VS 2012 IDE and the application built from VS 2012. They seem to have their own instances of whatever version of the registry they are reading from.
Finally, I opened up the Visual Studio 2012 command prompt and typed Regedit. It opened up RegEdit and it was viewing the old registry! All of the stale values within HKLM\Software\ were present - a seemingly completely separate version of the registry. Where is it getting this from?
My environment: Windows 7 Enterprise, VS 2012 Ultimate, console application built in 64-bit.
It should be noted that I have not made any major environment changes that I recollect and this is a new issue on my previously working development system. My colleagues have the same/similar environment and hardware setups with the same code base and have never encountered or seen this issue.
Things I've tried.
The almighty reboot
Uninstalling / Re-installing VS Studio 2012 as well as wiping out my code base, pulling it fresh and rebuilding (brute force I know...).
Checking the Registry for Wow6432Node keys to see if the reads/writes are getting redirected (I do not have a HKLM\Software\Wow6432Node and no other instances of that key have the old stale data or much else for that matter)
Searching the entire registry for the stale keys/values/data I'm seeing (not found anywhere)
Turning off virtualization using 'reg FLAGS hklm\software\ SET DONT_VIRTUALIZE DONT_SILENT_FAIL RECURSE_FLAG' as well as variations of this with one flag at a time.
Writing and debugging a unit test to try and determine anything.
VS 2012 safe mode
VS 2012 logging to see if the log file could shed any light on the problem.
Cursing (quietly because I'm at work)
Bribes (my workstation has yet to respond to these attempts)
Any help would be greatly appreciated. I'm close performing a clean Windows installation on my workstation but would rather save myself the time and trouble of setting everything up again :)
I downloaded Visual Studio 2012 yesterday when it was released on MSDN. I have noticed that a few of the project types that we had in 2010 are gone or different. The biggest difference for me right now is the removal of the Windows Installer project. Now we are being forced to use the InstallShield LE (Limited Edition). The problem here is that I write a ton of Windows Services and I can't see how to setup InstallShield LE. It appears that we (my company) will have to invest in licenses for the professional edition.
Has anyone found a way to install services in InstallShield LE? When using the Windows Installer project, you just set the custom actions.
For Visual Studio 2012 & InstallShield LE, do the following:
Run through the InstallShield project assistant and add the primary output of your service to the Application files section.
After you are done with the project assistant, double click the "Files" item under step two of the setup project.
Right click on the primary output of your service, and go to properties.
Click the "COM and .NET Settings" tab, and place a check in the "Installer Class" checkbox.
Click Ok
Now, once you build and run your install, your service will show up in the Windows Services snap in.
Note that this assumes you added a "Project Installer" to your service project (Right click on the service design sheet and click "add installer"). I can confirm this work on Windows 8 with Visual Studio 2012 / InstallShield LE.
I've recently installed VS 2012 with Install Shield LE. At first I kept getting a ISEXP -5036 internal server error after a build (this was after setting up a ISLE project and running through the Install Shield Project Assistant). Eventually I found out that it was trying to create the MSI in the DVD-5 media type which is where it was failing. For some reason, creating the solution again from scratch somehow recognizes to only build to the CD_ROM and SingleImage media types which works.
Anyway to rectify the 5036 error, click the Build tab in VS 2012 (top menu), select configuration manager and you should see that your IS setup file is selected on the DVD-5 configuration. Change this to CD_ROM and click close. Once you build/rebuild it will complete with no IS 5036 error.
While using the installer class checkbox may work for some instances, you may experience the following error:
Error 1001.The specified service already exists
Here is an excerpt from this link on how to resolve this issue:
For Error: Error 1001.The specified service already exists
This error will occur if the component installing a .NET Service is
incorrectly configured with ".NET Installer Class" set to Yes. The
method to install a .NET Service is to use Component\Advanced
Settings\Services view, not the ".NET Installer Class" setting.
Making definitions in the Component\Advanced Settings\Services view
creates entries in the Windows Installer ServiceControl and
ServiceInstall Tables. These entries are used by the Windows
Installer "InstallServices" action to install the Service.
If your project is .NET, then try then you can use the ServiceProcessInstaller class with InstallShield LE.
To get it to work with InstallShield, you have to go into the InstallShield "files" tree and right click on your file. Then check the checkbox for "Installer class" on the "COM and .NET settings" tab.
I have gotten it to work, but I've had problems on some OS's like Windows 2008R2. Your mileage may vary.
Here is an example: http://www.codeproject.com/Articles/14353/Creating-a-Basic-Windows-Service-in-C
I had all sorts of problems with this.
As follows.
InstallShield takes ages to download
the registration process is a pain.
the configuration options are confusing and overly complex.
the accepted solution on this thread is a hack and it doesn't always work - see 1001 in the documentation - essentially you need to get through the paywall to get the right configuration options to install a windows service.
Solution for me as mentioned elsewhere - was to abandon InstallShield
Very easy from that point.
Edit: Update - install the latest version from here https://wix.codeplex.com/releases/view/115492 for vs 2013 / 2015
Visual Studio setup projects are back in VS 2013 as a visual studio extension.
https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
Please update your solution and projects to VS 2013. If you are still in VS 2010, you are probably better off by upgrading directly to VS 2013.
My experience with Installsheild LE is that it is very quirky but once you figure out the tricks, it is easier to use. However, I think that the limited edition is a way by Microsoft and Flexera to sell the fully featured edition. In other words, first we pay Microsoft a lot of money for Visual Studio and then their partner (in crime) more for Installsheild. Bad strategy which did not work out since they had to bring back the setup projects in VS 2013.
I've written about this subject:
Augmenting InstallShield using Windows Installer XML - Windows Services
Basically you create a merge module using WiX to encapsulate the service and then add it to your installshield project. ( Be sure to associate to the INSTALLDIR directory to make sure your file goes where you expect ). Build and test on a VM. Piece of cake.
I'm using VS2012 and Installshield LE Spring Edition. I did not have to use Wix.
If you encounter the error "Could not create _isconfig.xml for use with InstallUtilLib.dll", please create a folder with the same name as your setup project and inside the setup project folder.
Credits to http://community.flexerasoftware.com/showthread.php?165929-Could-not-create-_isconfig-xml-for-use-with-InstallUtilLib-dll
I just got some problems finding where to add installer as referred in the answer. So here it is how.
Double click on your service class within your Windows service Project
A blank screen with the text "To add components to your class, drag them from the Toolbox and use the Properties window to set their properties..."
Right click anywhere but on the links and select "Add Installer"
see ya
Bear in mind that all the above explanation will not help you if you plan to create later an upgrade of that setup. InstallShiled LE can't stop the running service when you upgrade. You can't do it either from Window Service Installer -> BeforeInstall event.
Wanted to put this here;
On VS 2015, when doing this, I ran into the 1001 error upon installation repeatedly.
Answer on this page explained that on the newer versions (anything past 2012), apparently you need to explicitly leave the installer class option unchecked, and then add your windows service under the Services section under Step 3 of the installer project:
Error 1001 when installing custom Windows Service
After I installed Windows 8 perfectly legit statement like this doesn't work anymore:
#if DEBUG
Debugger.Launch();
#endif
Service starts ignoring that thing.
Yes, I am building the project in a debug mode.
if I change that to a Debugger.Break() - the service just fails, and still there's no dialog for attaching a debugger.
The secret lies in changing the registry key for the Visual Studio JIT debugger via the following:
reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f
Before making this change the value on my machine was 0x28. The above changes it to 0x8. In essence it removes the 0x20 flag.
If you search the Microsoft include files (WTypesbase.h) then you find the following:
#define APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY 0x20
Once you make this change then the JIT debugging window is displayed again. I believe that all of this relates to various session 0 security changes made by Microsoft.
Sourced from this post:
http://forums.arcgis.com/threads/69842-Debugging-your-SOE-on-Windows-8
Debugger.Launch would launch an application with a visual GUI. By default services do not interact with a desktop and thus anything they do cannot be "seen".
Support for interacting with the desktop has slowly been removed from Windows services ("Interact with the desktop" option has been removed from some Server versions for example). I would imagine they've continued this trend.
Windows Services by nature are not GUI applications, they can run before and after a user logs into a desktop and thus cannot show a GUI all the time. It's not generally a good idea to depend on an ability to have a GUI in a Service.
If what you want to do is debug a service, I suggest running it as a regular application so that you can do things like Launch and Debug. Shameless plug: you can see Developing Windows Services in Visual Studio for a way to write a service that supports that.
Is this a Windows Store app or a desktop app?
Try right-clicking on your project (the C# executable project if that's what you have) and selecting "Properties". Then in the left sidebar of options, click "Debug". In the "Start Action" section, check the box for "Do not launch, but debug my code when it starts".
Now you can hit F5 and run Visual Studio with breakpoints in your code, and it will sit and wait for you to fire up the process. Then run your application (outside of Visual Studio), and Visual Studio will attach the debugger.
I am trying something really simple in F# to try and test interaction with the SharePoint 2010 API. I think I am running into a general problem with F#. Is there anyway that an F# script can access the SharePoint 2010 API?
I think my problem is due to the F# scripts running 32bit, and the SharePoint API is in 64bit.
An example of the code I'm trying to run is as follows:
#r "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.sharepoint.dll"
#r "System.ServiceModel.dll"
open System
open Microsoft.SharePoint
let GetListByUrl (listUrl:string) =
use site = new SPSite(listUrl)
use web = site.OpenWeb()
let list =
if not (web = null) then web.GetList(listUrl)
list
In the visual studio editor it says the following error: The Type System.ServiceModel.ChannelFactory`1 is required here and is unavailable. You must add a reference to assembly ...
When the script is ran it gives the message: System.IO.FileNotFoundException: The Web application at... could not be found. Verify that you have typed the URL correctly...
Which is the error message I get if I try to access the SharePoint 2010 API from a 32bit c# console program. If I change the c# console program to Any CPU that message doesn't appear.
However I'm trying to do this in an F# script which I guess is 32bit, so how would I work around that?
Also since this is probably a general problem with F# scripts and 64bit dlls, how would you work around the problem of needing to reference 64bit dlls in F# scripts?
Edit
I used corflags.exe in the visual studio cmd prompt to modify the fsi.exe to 64bit. I followed this guide: http://ig2600.blogspot.com/2010/05/making-fsharp-interpreter-fsi-run-in.html. That seemed to work, though the F# interactive window seemed slower. However when I ran the code above in the now 64bit fsi it said sharepoint does not work with .net 4.0. How would you run the F# interactive window in .net 3.5?
Edit
Because of the answer posted by F.Aquino in which he said I needed to add a reference to System.ServiceModel I have updated the code to add that.
That fixes the visual studio editor complaints that keep appearing with red squiggly lines everywhere. When the script is ran the results are the same, the script cannot access the sharepoint 2010 API which is the problem I am having.
You need to add a reference to System.ServiceModel
I am very new to Installshield 2010. I have created a basic MSI setup for my application.
I need to check a few prerequisites for my application those are as below.
Microsoft frame work 3.5 with SP1.
Sql Express 2005.
Visual C++ redistributable
If any of the above things are not installed before means, I have to install while installing my application.
Can anyone guide me How I can install all these prerequisites before I installing my application?
Take a look at "Setup Prerequisites" and "Feature Prerequistes" They are the same except that the former are installed by setupe.exe before calling your MSI and the latter are installed by setup.exe (conditionally) after your feature selection and prior to the execution of the execute sequence in your msi.
If you go for the former, you probably also want to author AppSearch/System Search and Launch Conditions to block your MSI in case the user doesn't enter through the setup.exe.
InstallShield has predefined prereqs ( .PRQ's ) for each of those although I will caution you to atleast use SQL 2005 SP3 as there is a nasty bug in SP2 that can blue screen an XP machine. I'd actually really consider going with SQL 2008 R2.
Also found more info here in this page: http://kb.flexerasoftware.com/doc/Helpnet/InstallShield2011/IHelpSetPrereqCustom.htm
This one took me quite a while to find, hopefully I'll save you some time.
If you just want to force your user to have some applications installed (e.g. 'Visual C++ redistributable') or some specific configuration (e.g. specific Windows version/ reg value etc.)
You can use 'Behavior and Logic -> System Search' add the search for what you need (file/folders/registry entries/ini files values/XML file values),
On "What do you want to do with the value?" dialog select Store the values in the property and use the property in an Install Condition".
This will cause the Search to be executed when your installation package starts and will display an error popup to the user saying what ever message you've entered for the condition.
Few notes:
- If you're looking for a x64bit registry entry - mark the "Search the 64-bit portion of the Registry" check box.
- Did not find a way to edit the Condition once created, when tried to edit it it just lets me see and change the search parameters, but for the condition it only allows to enter it from scratch; as a workaround you can save the project as XML file (Installation Information -> General Information -> Project File Format) and edit the XML externally.
Good luck.