HiveMinds / tw-install

Automatically installs Taskwarrior, Taskserver (TODO: and Timewarrior). This project aims to support automated installation of all Taskwarrior hook scripts, configuration flavours etc. with a single command.
GNU Affero General Public License v3.0
17 stars 7 forks source link

Commented Lxrun being called #64

Closed a-t-0 closed 2 years ago

a-t-0 commented 3 years ago
      <p>Windows 10, Powershell 5.1. Downloaded zip file, extracted to downloads file and called the executable from powershell after changed execution policy.</p>

In the PS1 file, line 1080 is commented, but it seems like that is the line responsible for the first error.

If I continue with the installation, I also receive the same error again, and other errors. Full printout is shown below:

PS C:\Users\Rob\Downloads\Taskwarrior-installation-master\Taskwarrior-installation-master\AutoInstallTaskwarrior> .\TaskwarriorInstaller.exe
Installation process started at: 08/11/2020 09:54:03
Step -1
CREATING NEW TwConfigSettingsObject
Step -2
Step -3: getting testset1 data
Got Test Data
Step A
Written -restoreBackup + + True
Step B
Returning TwConfigSettingsObject
Created the temporary TwConfigSettingsObject
Got the username= testlinuxname
Got the username IN FIELD OF THIS OBJECT= testlinuxname
LinuxUsername= testlinuxname
Returning TwConfigSettingsObject
Hi, the installation takes around 45 minutes, it'll say "I'm finished" at the bottom of the screen when it's done, please have some fun until it does:)
Step 0. Starting with installing WSL Ubuntu 16.04:
lxrun : The term 'lxrun' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Rob\AppData\Local\Temp\Quest
Software\PowerGUI\f3008482-f1be-4799-a904-c0b38b3b9606\TaskwarriorInstaller.ps1:805 char:19
+         $output = lxrun /install /y
+                   ~~~~~
    + CategoryInfo          : ObjectNotFound: (lxrun:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Step 4 Gradle is pretty awesome software that automatically builds stuff. It is used to "compile/build" the java projects, if I would've done that before you'd downloaded it, it would not be "OpenSource" or a lot more difficult to see the code, now its more simple for you to see what is built.
Step 4.1 Install the prerequisites for so that the installation can install and use gradle. Yes we automated automation :D. Commencing update of reference repositories:
[sudo] password for rob:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Step 4.2 Installing java runtime environment
[sudo] password for rob:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

1
Reading package lists... Building dependency tree... Reading state information... default-jre is already the newest version (2:1.11-72). 0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded.
Step 4.3 Setting default linux username back to your chosen username so that python is installed for the correct user. The username you chose is: testlinuxname
lxrun : The term 'lxrun' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Rob\AppData\Local\Temp\Quest
Software\PowerGUI\f3008482-f1be-4799-a904-c0b38b3b9606\TaskwarriorInstaller.ps1:844 char:19
+         $output = lxrun /setdefaultuser $this.getLinuxUsername() /
+                   ~~~~~
    + CategoryInfo          : ObjectNotFound: (lxrun:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

/mnt/c/Users/Rob/AppData/Local/Temp/Quest Software/PowerGUI/f3008482-f1be/CustomSortServer/build.gradle
/bin/bash: gradle: command not found
2

/bin/bash: gradle: command not found
3

Step 5. Installing Taskwarrior by running the jar file that is compiled by gradle. This is done with command (arguments are added later):
Incoming arguments =
-linuxUsername testlinuxname -linuxPassword mypassword -twOrg testOrg -twUsername testtwname -isMultiDevices False -isServer True -hostname 0.0.0.0 -isUseOnAndroid True -skipAndroidInstallation False -restoreBackup True -featuresAns abcde
Returning (without arguments)
/mnt/c/Users/Rob/AppData/Local/Temp/Quest Software/PowerGUI/f3008482-f1be-4799-a904-c0b38b3b9606/build/libs/AutoInstallTaskwarrior.jar
Step end
Command= "/mnt/c/Users/Rob/AppData/Local/Temp/Quest Software/PowerGUI/f3008482-f1be-4799-a904-c0b38b3b9606/build/libs/AutoInstallTaskwarrior.jar"
lxrun : The term 'lxrun' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Rob\AppData\Local\Temp\Quest
Software\PowerGUI\f3008482-f1be-4799-a904-c0b38b3b9606\TaskwarriorInstaller.ps1:1062 char:1
+ lxrun /setdefaultuser $proceduralScript.getLinuxUsername() /y # This  ...
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (lxrun:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

lxrun : The term 'lxrun' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Rob\AppData\Local\Temp\Quest
Software\PowerGUI\f3008482-f1be-4799-a904-c0b38b3b9606\TaskwarriorInstaller.ps1:1063 char:13
+ Write-Host (lxrun /setdefaultuser $proceduralScript.getLinuxUsername( ...
+             ~~~~~
    + CategoryInfo          : ObjectNotFound: (lxrun:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Error: Unable to access jarfile /mnt/c/Users/Rob/AppData/Local/Temp/Quest Software/PowerGUI/f3008482-f1be-4799-a904-c0b38b3b9606/build/libs/AutoInstallTaskwarrior.jar
4

Done Installing taskwarrior
Step 6. Building/compiling timewarrior.
Step 6. installing timewarrior.
Step 7. Pretty rad, your tasks are automatically synced with your google calendar, installing the software now, ps. all credits go to bergercookie, as that is de developer of this part:
rob
Removing gCal file command=sudo rm /home/testlinuxname/maintenance/gCal
/bin/bash: sudo rm /home/testlinuxname/maintenance/gCal: No such file or directory
a-t-0 commented 3 years ago
      <p>Thank you, I think it is pretty awesome you're giving the installer a try! You are actually the first person to test it besides myself, so I hope you can spare me slight patience if my responses are somewhat slow. I will look into it later today.</p>
a-t-0 commented 3 years ago
      <p>Indeed line 1080 seems to be commented yet also seems to be responsible for the error. It does make me curious that the first error message refers to line 805 in the log you so kindly provided. I would have to look into it in more detail to understand how that is possible.</p>

Yet the underlying problem seems to be that lxrun is not available on your device. This lxrun is an old command used to control the WSL from commandline.

I think you already did this manually, and I think my code also does it automatically (in line 7), but just to verify, could you ensure
Windows Subsystems for Linux is enabled in the Windows Features? As illustrated in the next figure (doesn't have to show Beta):

image

In the meantime, I will look to determine why lxrun would not be available, I think it might be dependent on some windows update or version.

      <p><a href="https://github.com/MicrosoftDocs/WSL/issues/353" data-hovercard-type="issue" data-hovercard-url="/MicrosoftDocs/WSL/issues/353/hovercard">This issue with the same error message</a> suggests:</p>

wslconfig /unregister Legacy

Could you perhaps give that a try and retry execution of the ./TaskwarriorInstaller.ps1?