Intall msi as admin

tyler.carter's Avatar

tyler.carter

06 Oct, 2017 03:38 PM

Currently when I run command:
msiexec /i $msiPath /quiet /qn /norestart /log install.log"
OR
msiexec /a $msiPath /quiet /qn /norestart /log install.log"

The library doesn't get installed. Locally I have to run as admin for installation to work, is this possible on appveyor?

  1. 1 Posted by Ilya Finkelshte... on 06 Oct, 2017 03:48 PM

    Ilya Finkelshteyn's Avatar

    AppVeyor build agent runs with full Administrator privileges on build VM, with UAC disabled. And your commands run in that context. I would recommend to add type install.log to see what happens. Also maybe your msi require restart. In this case I would recommend to leave /norestart option but as next command run sleep 5; restart-computer -f; sleep 5 in PowerShell mode. Sleep is needed to let build process to send all tracing to central servers so you see uninterrupted log.

  2. 2 Posted by tyler.carter on 06 Oct, 2017 04:54 PM

    tyler.carter's Avatar

    Thank you for the quick reply. For reference here is the full script:
    $msiPath = "$($env:USERPROFILE)\OpenNI-Windows-x86-2.2.msi"
    "$msiPath"
    (New-Object Net.WebClient).DownloadFile('
    https://www.dropbox.com/s/48eksw8252u7yj8/OpenNI-Windows-x86-2.2.msi?dl=0',
    $msiPath)
    "Running install script"
    msiexec /i $msiPath /quiet /qn /norestart /log install.log"

  3. 3 Posted by Ilya Finkelshte... on 06 Oct, 2017 04:58 PM

    Ilya Finkelshteyn's Avatar

    I would remove this part:

    "Running install script" 
    Start-Process powershell -Verb runas
    
    Also check if this msi require restart if you do this interactively and if yes, try restart as I posted before.

    Note that you can experiment in RDP

  4. 4 Posted by tyler.carter on 06 Oct, 2017 05:00 PM

    tyler.carter's Avatar

    Oops didn't mean to include the runas line, had just tried that as an
    alternative. It doesn't require a restart. I'll try with rdp but any other
    suggestions would be great.

  5. 5 Posted by Ilya Finkelshte... on 06 Oct, 2017 05:03 PM

    Ilya Finkelshteyn's Avatar

    A lot of customers use the same command to install dependencies on the fly. I wonder how you know that it was not installed. Maybe you need to update path environment variable?

  6. 6 Posted by tyler.carter on 06 Oct, 2017 05:18 PM

    tyler.carter's Avatar

    Firgured it out, had "nuget restore" command before it and apparently was
    causing issues.

  7. 7 Posted by Ilya Finkelshte... on 06 Oct, 2017 05:25 PM

    Ilya Finkelshteyn's Avatar

    Good, thanks for the update

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac