Bug 393810 - Installation: don't require admin rights or abort if not provided
Summary: Installation: don't require admin rights or abort if not provided
Status: RESOLVED FIXED
Alias: None
Product: Craft
Classification: Developer tools
Component: Core (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Hannah von Reth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-03 16:44 UTC by qubodup
Modified: 2018-05-04 07:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qubodup 2018-05-03 16:44:12 UTC
I was not able to install Craft in PowerShell without admin rights:

*** Handling package: dev-util/craft-startmenu-entry, action: all ***
*** Action: fetch-binary for dev-util/craft-startmenu-entry ***
*** dev-util/craft-startmenu-entry not found in cache ***
*** Action: fetch for dev-util/craft-startmenu-entry ***
*** Action: unpack for dev-util/craft-startmenu-entry ***
*** Action: compile for dev-util/craft-startmenu-entry ***
*** Action: cleanimage for dev-util/craft-startmenu-entry ***
*** Action: install for dev-util/craft-startmenu-entry ***
*** Action: qmerge for dev-util/craft-startmenu-entry ***
No module named 'win32api'
Traceback (most recent call last):
  File "C:\CraftRoot\craft\bin\craft.py", line 477, in <module>
    success = main()
  File "C:\CraftRoot\craft\bin\craft.py", line 465, in main
    if not run(package, action, tempArgs, package.children.values()):
  File "C:\CraftRoot\craft\bin\craft.py", line 260, in run
    directTargets=directTargets):
  File "C:\CraftRoot\craft\bin\craft.py", line 125, in handlePackage
    success = success and doExec(package, "qmerge")
  File "C:\CraftRoot\craft\bin\craft.py", line 96, in doExec
    ret = package.instance.execute(action)
  File "C:\CraftRoot\craft\bin\Package\PackageBase.py", line 168, in execute
    return self.runAction(command)
  File "C:\CraftRoot\craft\bin\Package\PackageBase.py", line 276, in runAction
    ok = getattr(self, functions[command])()
  File "C:\CraftRoot\etc\blueprints\locations\craft-blueprints-kde\dev-util\craft-startmenu-entry\craft-startmenu-entry.py", line 27, in qmerge
    import win32com.client
  File "C:\Python36\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ModuleNotFoundError: No module named 'win32api'

This issue does not show up when running PowerShell as admin.

Either:

1. make it work without admin rights or
2. check for admin rights before starting work that has to be re-done later, warn user about admin rights being required and abort.

How to check: https://blogs.technet.microsoft.com/heyscriptingguy/2011/05/11/check-for-admin-credentials-in-a-powershell-script/

You can link to https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6#with-administrative-privileges-run-as-administrator to teach user how to run as admin
Comment 1 Hannah von Reth 2018-05-04 07:25:14 UTC
Fixed in master