Setup Docker service to use insecure(http) registry instead of https

By default docker use https to connect to docker registry. But there can be use cases to use insecure registry. Here are the steps to use insecure registry.

In ubuntu
edit the file /etc/default/docker and update DOCKER_OPTS e.g

DOCKER_OPTS='--insecure-registry 10.84.34.155:5000'

where 10.84.34.155 is ipaddress of registry and 5000 is your port on which registry is configured.

In Centos
Edit the file /etc/docker/daemon.json e.g.

{
"insecure-registries" : ["10.84.34.155:5000"]
}

where 10.84.34.155 is ipaddress of registry and 5000 is your port on which registry is configured.

Restart docker
$ service docker restart

Tagged : / / / / /

VbScript To Delete Registry Value Data

deployexpert created the topic: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Hi everyone,

Need an urgent help. Need a script to delete a registry value. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]
“AppInit_DLLs”=”SAMPLE”

I only want to delete the data value “SAMPlE”

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Seriously? Well, you asked for it! 🙂 www.lmgtfy.com/?q=vbscript+delete+registry+value

deployexpert replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
While using the Google hint Ian gave you; you want to set an entry to empty (“”) and not delete it

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Thanks for ur help.
I only want to delete the value data = “SAMPLE” if it exist in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]
“AppInit_DLLs”=”SAMPLE”

The AppInit_DLLs has different values in it. Just want to delete the value “SAMPLE” in the value data

deployexpert replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Again, using what Ian pointed to:

1) read the current value
2) If Value = “SAMPLE” then Write value = “”
3) (Else do nothing)

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
this is my script but it does not delete the strvalue.

Option Explicit
Const HKEY_LOCAL_MACHINE = &H80000002

Dim strComputer
Dim objRegistry
Dim strKeyPath
Dim strValueName
Dim strValue
Dim arrValues
Dim intValue

strComputer = “.”
Set objRegistry=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &_
strComputer & “\root\default:StdRegProv”)

‘Get String value
strKeyPath = “Software\Microsoft\Windows NT\CurrentVersion\Windows”
strValueName = “AppInit_DLLs”
strValue = “PGPmapih.dll”
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

‘Delete String value
strKeyPath = “Software\Microsoft\Windows NT\CurrentVersion\Windows”
strValueName = “AppInit_DLLs”
objRegistry.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Hi,

Try the below code and let me know…


Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer & “\root\default:StdRegProv”)

strKeyPath = “Software\Microsoft\Windows NT\CurrentVersion\Windows”
strStringValueName = “AppInit_DLLs”

oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
TBH, you won’t get very far in packaging without some scripting skills.

I don’t normally spoon-feed, but what the hell…some array handling for you to pick the bones out of. It’s completely off the top of my head and untested:

Dim blnResult
Dim arrRegValue
Dim strTempRegValue
Dim strTemp
Dim intArrayIndex_RegValue
Dim blnMatchFound

Const strRegValueSeparator = “,” ‘// or whatever the values are separated with
Const strSearch = “SAMPLE” ‘// this is the text you want removed from strValue

arrRegValue = Split(strValue, strRegValueSeparator)

strTempValue = “”

For intArrayIndex_RegValue = 0 To UBound(arrRegValue)
strTemp = arrRegValue(intArrayIndex_RegValue)
blnResult = StringMatch(strTemp, strSearch, blnMatchFound)
If blnResult Then
If Not blnMatchFound Then
‘// The strings didn’t match the one we’re searching for so add it to the temporary variable
If Len(strTempValue) = 0 Then
strTempValue = strTemp

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Dim blnResult
Dim arrRegValue
Dim strTempRegValue
Dim strTemp
Dim intArrayIndex_RegValue
Dim blnMatchFound

Const strRegValueSeparator = “,” '// or whatever the values are separated with
Const strSearch = “SAMPLE” '// this is the text you want removed from strValue

arrRegValue = Split(strValue, strRegValueSeparator)

strTempValue = “”

For intArrayIndex_RegValue = 0 To UBound(arrRegValue)
strTemp = arrRegValue(intArrayIndex_RegValue)
blnResult = StringMatch(strTemp, strSearch, blnMatchFound)
If blnResult Then
If Not blnMatchFound Then
'// The strings didn't match the one we're searching for so add it to the temporary variable
If Len(strTempValue) = 0 Then
strTempValue = strTemp
Else
strTempValue = strTempValue & strRegValueSeparator & strTemp
End If
End If
End If
Next

'// Now write strTempValue to registry

'//=========================================================================================================
'// Name: StringMatch
'// Purpose: Checks if two strings match
'// Why not use 'If strFirst = strSecond', you're asking?
'// Well, the 'Equals' operator :
'// – is not very fast (at string comparison)!
'// – compares strings left to right and is smart enough to stop comparing when it spots the first difference, but
'// – is too dumb to first do the most obvious test: comparing the lengths of the strings!
'// Input: strFirst – the first string
'// strSecond – the second string
'// blnMatch – a Boolean indicating whether or not the strings matched
'// Output: None
'// Returns: True/False
'//
'//=========================================================================================================
Function StringMatch(ByVal strFirst, ByVal strSecond, ByRef blnMatch)

StringMatch = True

blnMatch = False

If LenB(strFirst) = LenB(strSecond) Then
blnMatch = (InStrB(1, strFirst, strSecond, vbBinaryCompare) <> 0)
End If

End Function

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
@VBScab. Tnx so much for ur help. here’s a simple one that works but it deletes the whole value instead of the said value mention in script.
Dim WSHShell
Set WSHShell = WScript.CreateObject(“WScript.Shell”)
Dim returnval
returnval= WSHShell.RegRead(“HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs”)

if instr(returnval, “PGPmapih.dll”) > 0 then
‘”PGPmapih.dll” exists so set it to nothing
WSHShell.Regwrite “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs” , “”
end if

applicationPackaging replied the topic: Re: VBSCRIPT TO DELETE REGISTRY VALUE DATA
Hi Guys. Tnx all for ur help. Got a working script at the end of the day and sharing it. Script is pasted below.

‘**********************************************************************************************************************************************
‘ This Script performs the following tasks
‘ 1. Checks the Users Permissions to the registry
‘ 2. If the user has access to write to the registry searches to see if the
‘ following registry key exists and return the values: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\APPINIT_DLLS
‘ Searches to see if PGPmapih.dll is a value and strips it out
‘ Replaces the PGPmapih.dll with blanks
‘ 3. Writes all errors etc… to a log file c:\winnt\temp\pgpmapih_fix.log
‘***********************************************************************************************************************************************

‘**************
‘Start of Code
‘**************

On Error Resume Next

Const ForWriting = 2
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objFile = objFSO.CreateTextFile(“C:\WINNT\Temp\pgpmapih_fix.log”, ForWriting)

‘Declare and Set any variables
pgpvalue = “PGPmapih.dll”
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”
Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &_
strComputer & “\root\default:StdRegProv”)

‘ Check Permissions to see if current user can write to registry
Set StdOut = WScript.StdOut
strKeyPath = “SYSTEM\CurrentControlSet”

oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_QUERY_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
objFile.WriteLine (date & ” ” &Time &” User Has Query Value Access Rights”)
Else
objFile.WriteLine (date & ” ” &Time &” User Does Not Have Query Value Access Rights”)
End If

oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_SET_VALUE, _
bHasAccessRight
If bHasAccessRight = True Then
objFile.WriteLine (date & ” ” &Time &” User Has Set Value Access Rights”)
Else
objFile.WriteLine (date & ” ” &Time &” User Does not have Set Value Access Rights”)
End If

oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, KEY_CREATE_SUB_KEY, _
bHasAccessRight
If bHasAccessRight = True Then
objFile.WriteLine (date & ” ” &Time &” User Has Create SubKey Access Rights”)
Else
objFile.WriteLine (date & ” ” &Time &” User Does Not Have Set Create Subkey Access Rights”)
End If

oReg.CheckAccess HKEY_LOCAL_MACHINE, strKeyPath, DELETE, bHasAccessRight
If bHasAccessRight = True Then
objFile.WriteLine (date & ” ” &Time &” User Has Delete Access Rights”)
Else
objFile.WriteLine (date & ” ” &Time &” User Does Not have Delete Access Rights”)
End If

‘Change Path to PGP One
strKeyPath = “SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows”
strValueName = “AppInit_DLLs”

‘Search Registry to find the Key
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
objFile.WriteLine (date & ” ” &Time &” Value of Registry Key ” & strvalue)

if isnull(strKeyPath) then
objFile.WriteLine (date & ” ” &Time &” ERROR: Registry Key Path Not Found”)
objFile.Close
wscript.quit
else

If isNull(strvaluename) then
objFile.WriteLine (date & ” ” &Time &” ERROR: Registry Key Does Not Exist on PC”)
objFile.Close
wscript.quit
else

If strvalue = “” then
objFile.WriteLine (date & ” ” &Time &” Registry Key VALUE Is Blank”)
objFile.WriteLine (date & ” ” &Time &” No Need to Run Script, Now Quitting”)
objFile.Close
wscript.quit
else

objFile.WriteLine (date & ” ” &Time &” Registry Key Found”)

end if
end if

newstrvalue = instr(strvalue,pgpvalue)
if newstrvalue = 0 then
objFile.WriteLine (date & ” ” &Time &” PGP Value not found on machine”)
objFile.WriteLine (date & ” ” &Time &” No Need to Run Script, Now Quitting”)
objFile.Close
wscript.quit

else
End if
newstrvalue = Replace(strvalue,pgpvalue,””)
objFile.WriteLine (date & ” ” &Time &” Changing Registry key value to: ” & newstrvalue)

‘Write new Key
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,newstrValue
objFile.WriteLine (date & ” ” &Time &” SUCCESS: Values Written to Registry”)
objFile.WriteLine (date & ” ” &Time &” Closing Script… END…”)
End if
objFile.Close
Wscript.quit

Tagged :

How to handle Registry Redirection through WIX on64-bit Platform

InstallerGeek created the topic: How to handle Registry Redirection through WIX on64-bit Platform
Hi,

I’m facing issues while fetching the Installation Path of a 64-bit component through its Registry Entry on 64-bit Platform. Through WIX, when I’m searching for a particular registry key, because of registry redirection it is redirected to WOW6432node where registry keys doesn’t exist. So, through WIX, is there any way to look into the 64-bit Registry View with only Single MSI creation?

Here are some of my findings about the same :

1. A component must be marked as Win64=”yes” in order to cause registry entries to be written under the 64-bit registry hive instead of the WOW64 registry hive.

2. Refer stackoverflow.com/questions/1838009/plat…ification-in-wix-3-0 , telling that we can use the Condition statement (documentation here< wix.sourceforge.net/manual-wix2/wix%5Fxsd%5Fcondition.htm >) which will detect at install time which platform the installer is running on. This allows you to create just one installer which will work on all platforms.

The test for 64bit platform is VersionNT64 and conversely the test for non 64bit platforms is NOT VersionNT64

For example:

InstallerExpert replied the topic: Re: How to handle Registry Redirection through WIX on64-bit Platform
Use Win64=”yes” in your RegistrySearch Elements to force them to check the normal areas of the Registry rather than the WOW6432Node. You will get ICE warnings for this in an x86 package.

However you can’t have one MSI which works natively for both x86 & x64 platforms.
An MSI has a platform attribute which must be set to “Intel” for x86 packages or “Intel64” for x64 packages (can also use “AMD64” for x64 packages but it’s deprecated by “Intel64”). An x86 package will install on x86 and x64 platforms but you will not be able to write to x64 specific locations such as the normal registry areas (everything gets redirected to WOW6432Node) or the normal “Program Files” directory (again everything gets redirected to “Program Files (x86)”). You can see this in a verbose log quite easily.
If you want or need to access x64 specific areas of the machine you need to create an x64 package which won’t even run on an x86 platform.
Hence that second post on your thread on StackOverflow is very misleading if taken as read. Having 2 MSI’s might not be a desirable solution for you but it’s the only one you’re going to get if you want to use Windows Installer to deploy your product.

Good Luck.

InstallerExpert replied the topic: Re: How to handle Registry Redirection through WIX on64-bit Platform
You will need two searches: one for the 32-bit and one for the 64-bit search.

InstallerExpert replied the topic: Re: How to handle Registry Redirection through WIX on64-bit Platform
Some confusion here? I believe it’s

Intel – 32-bit x86
Intel64 – Itanium family
AMD64 – 64-bit x86, deprecated
x64 – 64-bit x86

InstallerGeek replied the topic: Re: How to handle Registry Redirection through WIX on64-bit Platform
Thanks Palbinder for your reply. Well, whatever replies I’ve got for this issue are convincing me for two separate MSIs for 32-bit and 64-bit Platforms resp. I’ve one more query related this. I’m not sure whether to ask but still is it possible to write inline code in WIX? If so, I could probably give a try to write the code for disabling registry redirection by Accessing an alternate registry view depending on Platform Architecture.

Any replies on this will be much appreciated.

InstallerExpert replied the topic: Re: How to handle Registry Redirection through WIX on64-bit Platform
Yep, my mistake. Was looking at a package in InstEd! at the time & forgot about Itanium platform support as it still shows only “AMD64” for the x64 platform where as Orca has both “AMD64” & “x64” IIRC (haven’t had it installed in a long time so I might be wrong).

Tagged :

How to clean the computer registry

manoukwan created the topic: How to clean the computer registry
A computer registry is a Windows specific aspect of a computer. It contains information on just about everything a computer does. And cleaning it can certainly be a long and tedious project. Below are some things to consider for how to clean up computer registry with registry cleaner.

The first thing anyone should know about cleaning a registry is to not do it manually. Consider the fact that everything your computer does is on there, from web browsing to installed programs. So if a file gets deleted or replaced without knowing what it does, it could seriously damage the computer.

The alternative option is to use a registry cleaning program. But, before anything is done to the registry, a backup needs to be made (that way, if something is broken, it can be restored). Usually, third-party programs have a way of doing it themselves. For the ones that don’t, there’s a manual way to do it, using the Windows Registry Editor.

When using a third-party program, it’s important to know which ones won’t accidentally break the computer. Some programs can delete key registry items and cause more problems than they solve. As such, it’s best to check either ZDNet, CNET, PC world, or PC magazine for the latest on helpful (and harmful) programs to use.

By cleaning up the registry, old (and even unused) registry items are removed, giving a little more space and a lot more processing power. Old registries, such as the ones from uninstalled files, usually connect to locations that don’t exist or that can’t be found, slowing down the computer. By removing them, the computer can focus on the task at hand.

Tagged :