Add Registry Key after install win 32 application

Dilan Nanayakkara 1,111 Reputation points
2021-03-03T06:11:58.643+00:00

HI all,

Appreciate the help on below.

I have a requirement of adding a registry value after installing the CloudDrive Mapper software in Intune. I have installed the application successfully using the below script(.bat) with Win32 app. However the registry key is not in place properly either under the local machine or current user. So appreciate the help here.

start

msiexec /i "SetupCDMx64.msi" /qn LANGUAGE=EN-GB RUN=TRUE

REG ADD "HKCU\Software\IAM Cloud\CloudDriveMapper" /v "LicenceKey" /t "REG_SZ" /d "t47a6c1a2ad8e491b474a4111a7e76db10aef0e68dfe5d766c9984348" /f

Start "" "c:\program files\IAM Cloud\Cloud Drive Mapper\CloudDriveMapper.exe"

end

PS: I have tried to deploy via Posershell script using below command but it didn't successfull either.

Set-ItemProperty -Path Registry::"HKLM\Software\IAM Cloud\CloudDriveMapper" -Name "LicenceKey" -Type "String" -Value "t47ac16a2ad8e491b474a4111a7e76db10aef0e68dfe5d766c9984348" -Force

Thanks,
Dilan

Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
909 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,674 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dilan Nanayakkara 1,111 Reputation points
    2021-03-05T17:11:09.16+00:00

    @Lu Dai-MSFT Thanks for the help!

    based on the research that I had so far, Intune win32 app is running as 32 applications by default, and as a result registry settings are in place under WOW6432Node. below is the solution:

    I have changed the default intune win32 app behavior and configured the script to run as a 64 bit. it's all good now.

    Thanks,
    Dilan


2 additional answers

Sort by: Most helpful
  1. Lu Dai-MSFT 28,366 Reputation points
    2021-03-03T09:03:37.47+00:00

    @Dilan Nanayakkara Thanks for posting in our Q&A.

    For this issue, we appreciate your help to check if you set "Run script in 64 bit PowerShell Host" to "Yes" when deploying the PowerShell script via intune.
    73752-image.png
    In my research, I find that if we run the script using the intune Win32 app deployment, we will run PowerShell as a 32-bit app and it will creat registry keys under the WOW6432Node registry key, not in the right place. We can refer to the following link:
    https://blog.italik.co.uk/running-powershell-scripts-using-intune/
    Note: Non-Microsoft link, just for the reference.

    If there is anything unclear, feel free to let us know..


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Rahul Jindal [MVP] 9,551 Reputation points MVP
    2021-03-07T11:03:26.18+00:00

    What is your end goal? Registry in HKLM or HKCU? HKCU will require to execute the script in user context.