Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to Create a Win32 Application from a intunewin file which is created from .exe #173

Open
Subhajit-Dutta opened this issue Aug 19, 2024 · 6 comments

Comments

@Subhajit-Dutta
Copy link

Subhajit-Dutta commented Aug 19, 2024

I am trying to create a win32app from a intunefile . The intunefile got created from a .exe and not from a MSI . I am getting error while deploying the win32 app .

Here is how I am creating an detection rule

Detection Rule

$DetectionRule = New-IntuneWin32AppDetectionRuleRegistry -StringComparison -KeyPath "HKEY_LOCAL_MACHINE\SOFTWARE\xxxxxx\yyyy\xx" -ValueName "Version" -StringComparisonOperator "equal" -StringComparisonValue "0.0.0110"

Requirement Rule

$RequirementRule = New-IntuneWin32AppRequirementRule -Architecture "x64" -MinimumSupportedWindowsRelease "W10_1909"

Return Codes

$ReturnCode = @{
0 = "Success"
1707 = "Success"
3010 = "Soft reboot"
1641 = "Hard reboot"
1618 = "Retry"
}

In below step I am creating Win332 app

Add Win32 Application

$Win32App = Add-IntuneWin32App -FilePath "C:\Users\some.user\Desktop\target_Intunefile\installer.intunewin" -DisplayName "xxxxxx"
-Description "yyyyy" -Publisher "xxxxxxxxxx"
-InstallExperience "system" -RestartBehavior "suppress"
-DetectionRule $DetectionRule -RequirementRule $RequirementRule
-ReturnCode $ReturnCode `
-Verbose

Here is my error while creating a win32 app

WARNING: An error occurred while creating the Win32 application. Error message: Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.

@Subhajit-Dutta
Copy link
Author

Subhajit-Dutta commented Aug 21, 2024

I can see that detectionValue is not getting set . Can you please show me , how to set it , as it is not getting set here , it is creating issue while creating win32 app
``
PS C:\WINDOWS\system32> $DetectionRule = New-IntuneWin32AppDetectionRuleFile -Existence -Path "C:\program files\xxxxxx" -FileOrFolder "installer.exe" -DetectionType "exists"
PS C:\WINDOWS\system32> $DetectionRule | Format-List *

Name : @odata.type
Key : @odata.type
Value : #microsoft.graph.win32LobAppFileSystemDetection

Name : operator
Key : operator
Value : notConfigured

Name : detectionValue
Key : detectionValue
Value :

Name : path
Key : path
Value : C:\program files\xxxxxxxx

Name : fileOrFolderName
Key : fileOrFolderName
Value : installer.exe

Name : check32BitOn64System
Key : check32BitOn64System
Value : False

Name : detectionType
Key : detectionType
Value : exists

PS C:\WINDOWS\system32>
``

@AlkHacNar
Copy link

AlkHacNar commented Aug 28, 2024

what detection do you want to use file or registry?
in file you don't need detectionValue if you use exist.
But I'm not seeing install and uninstall command on your Add-IntuneWin32App command. On an MSI if gets the info from the msi itself, on the EXE you need to give the commands, if I'm not wrong

@Subhajit-Dutta
Copy link
Author

what detection do you want to use file or registry? in file you don't need detectionValue if you use exist. But I'm not seeing install and uninstall command on your Add-IntuneWin32App command. On an MSI if gets the info from the msi itself, on the EXE you need to give the commands, if I'm not wrong

anyone is fine , either registry or file . I have tried with both and got same error . Name : detectionValue Key : detectionValue Value :

this value is empty

@AlkHacNar
Copy link

AlkHacNar commented Aug 28, 2024

your registry detection have a detectionValie, you file detection doesn't have it, cause you have exist, so it's always null. So that should be ok. but you don't have the install and uninstall commands set which are required. if you package a msi they gets populated themselfs.

@Subhajit-Dutta
Copy link
Author

your registry detection have a detectionValie, you file detection doesn't have it, cause you have exist, so it's always null. So that should be ok. but you don't have the install and uninstall commands set which are required. if you package a msi they gets populated themselfs.

@AlkHacNar Could you please help to update parameter that i need to pass for install and uninstall in $Win32App = Add-IntuneWin32App -FilePath "C:\Users\some.user\Desktop\target_Intunefile\installer.intunewin" -DisplayName "xxxxxx" -Description "yyyyy" -Publisher "xxxxxxxxxx" -InstallExperience "system" -RestartBehavior "suppress" -DetectionRule $DetectionRule -RequirementRule $RequirementRule -ReturnCode $ReturnCode
-Verbose`

@AlkHacNar
Copy link

AlkHacNar commented Aug 28, 2024

$InstallCommand = "setup.exe /S"
$UninstallCommand = "setup.exe /S /U"
$Win32App = Add-IntuneWin32App -FilePath "C:\Users\some.user\Desktop\target_Intunefile\installer.intunewin" -DisplayName "xxxxxx" -Description "yyyyy" -Publisher "xxxxxxxxxx" -InstallExperience "system" -RestartBehavior "suppress" -DetectionRule $DetectionRule -RequirementRule $RequirementRule -ReturnCode $ReturnCode -InstallCommandLine $InstallCommand -UninstallCommandLine $UninstallCommand -Verbose

something like that. you don't need to use variables there, but I like it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants