Jump to content


  • 0
BogdanR

Deploy application & registry key using .bat

Question

Hi,

 

I have a simple application that I need to install, another old one which I need to uninstall it first and I need to make a registry change along with it. I chose to batch the process, and here’s what I have:

 

Uninstall:

 

msiexec /uninstall {19ED22B4-4058-4BB6-AFBB-357D6383534E} /quiet

 

Install:

 

Msiexec /q /i "\\fileserver\Source$ \Laserform_Intranet_Client_2.3\LFormInetClient.msi" SQLSERVER="Server" WEBSERVER="http://Server/LformInet/Default.aspx" DMSID="MHODMA"

 

 

Update registry key:

 

regedit.exe /s "%~dp0change.reg"

 

 

The two registry keys looks like this:

 

Windows Registry Editor Version 5.00

 

[HKEY_CURRENT_USER\Software\Laserform\LFormInet]

"SQL Server"="Server"

"URL"="http://Server/LformInet/"

"DBTYPE"="SQL"

"SQL ServerLive"="Server"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Laserform\LFormInet]

"SQL Server"="Server"

"DBTYPE"="SQL"

"ClientVer"="5.1.33"

 

 

In the end the .bat file should look like this:

 

msiexec /uninstall {19ED22B4-4058-4BB6-AFBB-357D6383534E} /quiet

 

Msiexec /q /i "\\fileserver\Source$ \Laserform_Intranet_Client_2.3\LFormInetClient.msi" SQLSERVER="Server" WEBSERVER="http://Server/LformInet/Default.aspx" DMSID="MHODMA"

 

REM Check if 32-bit command-prompt launched on 64-bit OS

IF "%PROCESSOR_ARCHITEW6432%"=="AMD64" SET REGPATH=%SystemRoot%\SysWOW64\REGEDIT.EXE

 

%REGPATH% /s "%~dp0change.reg"

 

 

So from what I understand so far (at least this is what someone explain it to me) it is possible that the registry edit won’t work if run through ConfigMgr though for two reasons. First, you are trying to modify a value specific to a user and second because you are trying to modify a value in the 32-bit section of the Software hive.

 

Anyone have other experiences using something like this ?

 

Thank you.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

trying to modify a value in the 32-bit section of the Software hive.

Not a problem, have you tried doing this to see if it works. I usually use a "Reg add" command to put reg keys into a machine. You can force "reg Add" to place it in the wow6432 hive. By default it places it in the 64bit hive, but using a "/reg:64" will ensure the entries goes into the 32bit hive

 

trying to modify a value specific to a user

correct. This one is tricky but heres one way to do this:

 

1 - Create a "Application" or "Package" that runs for the user (but with administrative rights), I had a scenario where i needed to send out a reg key to HKCU so created a Application, which applies a batch file. The application is set to install for user therefore works for every user who logs onto the machine (as the application detection method checks HKCU if the key exists, therefore anybody who logs on will get the key if they dont already have it)

 

You could also use Orca to edit the MSI file and insert those regkeys into it, although thats a bit more involving.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.