NAV ClickOnce installation with PowerShell failed.

yasith
Member Posts: 30
Hi All,
I am trying to configure a NAV ClickOnce installation setup using PowerShell.
But when I tried to modify Application Manifest file using following commands, it gives an access denied error.
...
Set-ApplicationManifestFileList -ApplicationManifestFile $ApplicationManifestFile -ApplicationFilesDirectory $ClickOnceApplicationFilesDirectory -MageExeLocation $MageLocation
Set-ApplicationManifestApplicationIdentity -ApplicationManifestFile $ApplicationManifestFile -ApplicationIdentityName $ApplicationIdentityName -ApplicationIdentityVersion
...
Error:
Start-Process : This command cannot be run due to the error: Access is denied.
At
\Sana Remote Installation Files\ClickOnceInstallationFiles\NAVAdministration\Windows\Start-ProcessWithErrorHandling.ps1:18 char:15
+ $result = Start-Process -FilePath $FilePath -PassThru -NoNewWindow -Redirect ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
You cannot call a method on a null-valued expression.
At
\Sana Remote Installation Files\ClickOnceInstallationFiles\NAVAdministration\Windows\Start-ProcessWithErrorHandling.ps1:24 char:12
+ while ($result.WaitForExit(5000) -eq $false) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
My login has administrator privileges and I can change the application manifest file manually using command prompt.
Can anyone please advise me to over come this issue?
Thanks!
I am trying to configure a NAV ClickOnce installation setup using PowerShell.
But when I tried to modify Application Manifest file using following commands, it gives an access denied error.
...
Set-ApplicationManifestFileList -ApplicationManifestFile $ApplicationManifestFile -ApplicationFilesDirectory $ClickOnceApplicationFilesDirectory -MageExeLocation $MageLocation
Set-ApplicationManifestApplicationIdentity -ApplicationManifestFile $ApplicationManifestFile -ApplicationIdentityName $ApplicationIdentityName -ApplicationIdentityVersion
...
Error:
Start-Process : This command cannot be run due to the error: Access is denied.
At

+ $result = Start-Process -FilePath $FilePath -PassThru -NoNewWindow -Redirect ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
You cannot call a method on a null-valued expression.
At

+ while ($result.WaitForExit(5000) -eq $false) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
My login has administrator privileges and I can change the application manifest file manually using command prompt.
Can anyone please advise me to over come this issue?
Thanks!
0
Answers
-
Hi all,
I figure out what went wrong in my scrip.
In the script, it has to specify mage file location. I specify only the mage folder location like bellow;
$MageLocation = 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools'
But when I specify the full path, it's working fine.
$MageLocation = 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe'
Cheers!
\:D/ \:D/ \:D/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions