Options

NAV ClickOnce installation with PowerShell failed.

yasithyasith Member Posts: 30
edited 2015-08-26 in NAV Three Tier
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 D:\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 D:\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!

Answers

  • Options
    yasithyasith Member Posts: 30
    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/
Sign In or Register to comment.