i created a web setup project in vs 2008 and added some custom actions.
While installing i get the default forms (apppool, appname, website), some pre-defined custom forms and some selfmade custom forms.
Now while installation i add some data in the registry.
I have only one problem: TARGETSITE property.
This property is filled by default form (Context.Parameters["TargetSite"] is something like "/LM/W3SVC/1" for defaultWebSite) and its value properly added to the registry.
Everthing is fine until i use the repair function...
Whilst repairing, the first few default forms will be skipped by installation, therefore the TARGETSITE property will be empty (Context.Parameters["Targetsite"] is "").
Sadly i can not interfere with that to get the needed value from registry where i added it for exactly that reason.
Because the registry values will be updated before custom code is triggered in the "override Install" method.
Even onBeforeInstall is fired after the registry has been updated.
If a rollback is done, while repairing, the registry key will be reset to the correct value before, so i have to believe, that somehow i can access this value from within my custom action code.
Someone has any suggestion on how to get this important value?
P.S.:
i tried to set the condition within the registrykey, so that it would only be updated when the TARGETSITE value is not empty, but i´m afraid this will be ignored big time...
TARGETSITE != "" in the registry keys condition-field has absolutely no efect whatsoever...
I solved the problem by working around the installers registry key.
I manually create a subKey under the installers registryEntry, where I store my Context.Parameters["TARGETSITE"] value.
So the repair feature will not overwrite the keyValue because it´s a custom key.
Now I have my value either in the context or in the registry.
FunFacts:
When I create the customKey within the Installers own key, I take advantage of the standart meachnism, which delets the installers registry key and with that my customKey will also vanish.
Maybe this might help if someone else faces this problem sometime...
Related
Hello i was seaching around for some time on how i remove from the IIS the validation key and the decryption key. as in the UI i cant see how i remove it.
Because it is only possible to choose from two options,
Let ASP.NET runtime automatically generate the key(s) at runtime. (aka, leave the check box checked)
Pre-generate the key(s) and hard code them. (aka, leave the check box unchecked)
and the management UI clearly presents both options to you and expects you to only flip the check boxes. There is no possibility to "remove" anything from there.
Unfortunately, I have the problem with setting condition for Registry value in Visual Studio Installer project.
The main goal is to suppress updating value for application registry key for application updating.Installer should not do anything for the value if it is already in application registry key.
In value properties, I see two significant:
Condition
Transitive, set as True
It seems that for condition the most suitable is:
NOT [HKLM\Software\Company\PasswordReset]{callSignInstance}
Where key is [HKLM\Software\Company\PasswordReset] and name of the value is callSignInstance.
But in this case value just disappears from registry key. What is correct condition should be for this case?
Best regards,
Oleh
I am uninstalling some application and reading the software installation enumeration value from registry.
The problem is after uninstallation it is not changing the registry value untill unless the screen or regedit is not refreshed. after refreshing only i am getting the correct value.
Could some one help me out to refresh the regedit in python codes.
Regards,
upendra
I assume that by "refreshing" the "screen," you mean restarting the computer? Regardless, you can be sure that whatever registry keys you've modified will be correctly updated after the system is restarted. The registry is updated with lazy flush and writer threads, so my guess is that the changes you're making aren't flushed back to the registry immediately, but your question doesn't provide enough information about how you're modifying these registry values for me to be able to propose an alternative solution.
Perhaps more importantly, what are you trying to do here? Are you trying to get your uninstaller to verify that your application has been uninstalled? Why is this necessary? I feel like there has to be a better way than expecting registry edits to be committed and then read back out immediately.
I have kind the same problem. I "install" a python tool and environment and create some system variables in the registry. To refresh the registry I do the following:
def RefreshEnv():
HWND_BROADCAST = 0xFFFF
WM_SETTINGCHANGE = 0x1A
SMTO_ABORTIFHUNG = 0x0002
result = ctypes.c_long()
SendMessageTimeoutW = ctypes.windll.user32.SendMessageTimeoutW
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, u'Environment',
SMTO_ABORTIFHUNG, 5000, ctypes.byref(result))
This method is not refreshing the registry like I expected. I still have to open the window to edit the system variables in Windows and just click OK to refresh them. Otherwise my installed tools are crashing with an KeyError while trying to catch the environment variables.
I don't know if the Refresh function abovee will help you (I guess not), but at least it's a try.
You can use either of:
Just restart windows explorer with SysInternal's Process Explorer, or
If you have chocolatey installed, you can just type refreshenv in a PowerShell.
I am modifying the registry key and want to read that values without restarting the system.
I am able to read manually if I refresh the screen (F5 Button), but could you let me know how to capture this through python.
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
I have a simple C# application that allows users to specify that it should be (or should not be) started with Windows; it does so by setting (or deleting) a registry key (namely, ...\Software\Microsoft\CurrentVersion\Run\MyApplicationHere).
I am using a VS setup project to create the installer for this program. I don't want the installer to create this key; it should only be created when the user selects the option from within the program.
Here is the issue: I would like the uninstaller to delete this key if it exists, preferably without resorting to any sort of hackery; if there is a simple "built-in" solution I would love to hear it. Thanks!
just right Click on Setup then Select View -> Registry, you can add a
registry key to the list. The key has properties (right click ->
Properties) AlwaysCreate,DeleteAtUninstall and Transitive keep
AlwaysCreate to false, and DeleteAtUninstall to true and Transitive to
true as well
adn its Done..
The Registry table is designed for this:
http://msdn.microsoft.com/en-us/library/aa371168(VS.85).aspx
See especially under the description of "Name":
If the Value column is Null, then the strings shown in the following table in the Name column have special significance.
- The key is to be deleted, if present, with all of its values and subkeys, when the component is uninstalled.
Try creating a custom uninstall action to remove the key. Not very "built in", but it's only a couple of lines of code.