Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update App Store Helper to improve/streamline different downloads and detection process #449

Closed
rat-moonshine opened this issue Feb 8, 2019 · 166 comments

Comments

@rat-moonshine
Copy link
Collaborator

rat-moonshine commented Feb 8, 2019

The rough draft on Moonshine SDK detection table as created by Justin:
Moonshine Brainstorm.pdf

The initial UI that created by Joel based on input from Justin:

image

An updated table design based on above:

moonshine plugin install ui mockup
(MASH_UI_Mockup.bmpr.zip)

Detection process should be available in both Windows and OSX.

We need to detect all possible installation directories for different SDKs (Flex, Feathers, Java, AIR etc.) in all possible ways:

  • Environment variable
  • Default path installation by Moonshine App Store Helper
  • $PATH variable
  • Anything else
@rat-moonshine rat-moonshine self-assigned this Feb 8, 2019
@rat-moonshine rat-moonshine changed the title Update App Store Helper to more streamline different downloads process Update App Store Helper to improve/streamline different downloads and detection process Feb 8, 2019
@rat-moonshine
Copy link
Collaborator Author

I would like to know the ordering of detection process against a component/SDK; Following are my assumption so far:

  1. Since accessing environment variable do not works on sandbox Moonshine, this will not apply on OSX
  2. Check if Moonshine internal field already set, i.e. internal JAVA_HOME path
  3. Check environment variable and try to set fields (?) Windows only
  4. Check default App Store Helper managed installation paths if already present
  5. Check system installation path for cases like JDK - question is, if found JDK path on OSX, how we ask user for access permit

@JoelProminic
Copy link
Contributor

I wrote up some quick descriptions and dependencies from the original list created by @JustinProminic. I excluded the features that are not currently implemented.

Feature Short Description Dependencies
Project Management Browse project tree, add and remove files Integrated
Project Templates Create new projects from templates Integrated
Editor Text editing, syntax highlighting search Integrated
Visual Editor GUI designer for Apache Flex and PrimeFaces interfaces Integrated
Tour de Flex Examples for Apache Flex Integrated
Away3D Modeler Create and edit 3D models Integrated
Editor Enhancements Type-ahead, follow references, code generation, etc. OpenJDK, Language-specfic SDK
Actioncript and Flex Compilation Compile and launch Actionscript and Flex projects Flex SDK, OpenJDK
Apache Royale Compilation Compile and launch Royale projects Royale SDK, OpenJDK, and maybe others for #453
Feathers Compilation Compile and launch Feathers projects Feathers SDK, Open JDK, (and similar dependencies to #453?)
Apache Ant Integration Run scripts to automate builds and packaging Ant SDK, OpenJDK
Subversion Integration Import and update Subversion projects SVN
Git Integration Import and update Git projects Git
PrimeFaces Preview Preview PrimeFaces interfaces in browser using lightweight Payara Server Maven (and Payara plugin), OpenJDK

Flex, Royale, Ant, and Maven have dependencies on Java. So far we have been able to rely on JAVA_HOME being set globally, but I think we need to revisit this if we want to support complete installations for new users. I'm planning to create a separate issue to discuss this.

@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Feb 19, 2019

This is how the listing will show inside Moonshine:

image
image

Following is a note on proposed Home screen:

image

App Store Helper:

image
image
image

rat-moonshine added a commit that referenced this issue Feb 22, 2019
…formation/methods other than using in other object 'type' (reference #449)
rat-moonshine added a commit that referenced this issue Feb 22, 2019
@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Feb 22, 2019

While thinking on when a particular SDK (i.e. Flex, Royale etc.) should be ticked in the above plugins table, I'm coming up by few thoughts. If this would be for Apache Royale, I see following ordering/choices to determine that Royale is available and can be marked as installed.

A

If (moonshineDefaultSDK.isAvailable && moonshineDefaultSDK.type == 'royale')

B

If Moonshine's SDK list contains an item which type is royale - user may have listed the item by his/her own

C

Search through default download location (by App Store Helper) to determine if Royale SDK has downloaded (i.e. ~/Downloads/MoonshineSDKs/Royale_SDK)

We can even cut to point.B directly.

rat-moonshine added a commit that referenced this issue Feb 25, 2019
…/issue_449_streamline_with_moonshine_helper

- SDK type-check updated (reference #449)
rat-moonshine added a commit that referenced this issue Feb 26, 2019
- Moonshine internal fields are now updates based on downloads by Moonshine SDK Installer (reference #449)
rat-moonshine added a commit that referenced this issue Feb 26, 2019
- Appropriate sections in Settings now open upon Configuration button click (reference #449)
rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Feb 26, 2019
rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Feb 26, 2019
rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Feb 26, 2019
rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Feb 26, 2019
@JoelProminic
Copy link
Contributor

I noticed that some of the download links in MoonshineSDKInstaller.app were incorrect:

SDK Download
Open JDK Downloads Ant
Apache Royale Correct
Feathers Correct, not linked to moonshine-ide.com
Ant Correct
Maven Correct
Subversion Feathers
Git Feathers

We still need to get a plan figured out for SVN and Git.

@JoelProminic
Copy link
Contributor

Some points @rat-moonshine and I discussed for Windows:

Environment Variable Logic

On Windows, we can find the location of existing SDKs by checking environment variables.

My suggested logic for Moonshine is:

  1. Confirm that the path is for a valid SDK. If not, ignore the value
  2. If this is a Flex, Royale, or Feathers SDK, then add it to the SDK list if it not present already
  3. If a default path is already set for this SDK in Moonshine, then do not change the existing value. This will the user-selected value from being overwritten on Moonshine startup.
  4. Use the environment variable path if no default path is currently selected for the SDK.

One potential problem is if the environment variable SDK is an older version (or different version - we may have problems with Java 11: #466) than what is bundled with Moonshine SDK Installer. In this case, the user may want to download the version from Moonshine SDK Installer, but this will be unavailable if Moonshine considers it to be already installed. This version issue needs more brainstorming, since it could also trigger if the user ran Moonshine SDK Installer previously.

Download Location

@rat-moonshine reported that we can use File.userDirectory to get the user home directory. I thinkwe should use this for the default download path: ${File.userDirectory}/MoonshineSDKs.

However, we don't have the same limitations for the directory on Windows, so we could allow the user to choose a different base directory. I would like to include this in the Windows interface, as long as it will not complicate the interface too much.

@JoelProminic
Copy link
Contributor

For brainstorming, here is an example mockup including both an option to change the installation location and a different icon for SDK version mismatches:
image

The Version Mismatch prompt could also include the path where the old SDK was found, if it was located by environment variables.

I am not happy with the extra complexity for this, so I am open to other ideas.

@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Feb 27, 2019

I noticed that some of the download links in MoonshineSDKInstaller.app were incorrect:

SDK Download Should Host @moonshine? More..
Open JDK Downloads Ant Not Sure Need archive download URL for 8.0.202 or 11.0
Apache Royale Correct Hosting -
Feathers Correct Not Sure At present, direct download from Feathers. However since the SDK is under Apache license (https://bit.ly/2H5FH1w) we probably can host to Moonshine; Do we need to get any acceptance from Josh?
Ant Correct Hosting -
Maven Correct Hosting -
Subversion Feathers Not Sure Need a plan for bundling archive
Git Feathers Not Sure Need a plan for bundling archive

rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Feb 27, 2019
- Environment variable procedure updated to work independently in SDK Installer application (reference Moonshine-IDE/Moonshine-IDE#449)
@piotrzarzycki21
Copy link
Collaborator

Just quick question - Did you reproduce that problem actually ?

@piotrzarzycki21
Copy link
Collaborator

Before calling the Apache SDK Installer library source and after license agreement accepted, this is the place which does some works. Notably in that method it creates some pre-defined directories to the file system through prepareBeforeDownloads().

Once the process done, it's suppose to continue to call the Apache SDK Installer library's API.

I will make simple test to confirm that problem. I will create Flex Desktop application and add code which is creating for me folder in location C:\Users\piotr\Documents - I will see whether I can reproduce that.

@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Mar 19, 2019

Just quick question - Did you reproduce that problem actually ?

No, as I mentioned everything seems to work normally for me even after I set 'Periodic Scanning' of Windows On and my usual anti-virus software has its real-time protection On.

@piotrzarzycki21
Copy link
Collaborator

I just tried create project in Documents folder and it's failed with following error:

: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex
: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex\build_air
: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex\src
: Unable to access file:C:\Users\piotr\Documents\TestFolderCreateFlex\build\TestFolderCreateFlex-app.xml
: Error #3003
: Error: Error #3003
: 	at actionScripts.plugins.as3project.importer::FlashDevelopImporter$/parse()
: 	at actionScripts.plugins.as3project::CreateProject/createFileSystemBeforeSave()
: 	at actionScripts.plugins.as3project::CreateProject/createSave()
: 	at flash.events::EventDispatcher/dispatchEvent()
: 	at mx.core::UIComponent/dispatchEvent()
: 	at MethodInfo-25757()
: 	at actionScripts.plugin.settings::SettingsView/save()
: 	at actionScripts.plugin.settings::SettingsView/handleSaveClicked()
:
: Click here to Report a Bug

Maybe we should change that default folder ? I changed location of project straight to C:\ and it went ok. What if we change default location of SDKs to C:\MoonshineSDKs ?

rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Mar 19, 2019
@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Mar 19, 2019

I just tried create project in Documents folder and it's failed with following error:

: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex
: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex\build_air
: Unable to access directory:C:\Users\piotr\Documents\TestFolderCreateFlex\src
: Unable to access file:C:\Users\piotr\Documents\TestFolderCreateFlex\build\TestFolderCreateFlex-app.xml
: Error #3003
: Error: Error #3003
: 	at actionScripts.plugins.as3project.importer::FlashDevelopImporter$/parse()
: 	at actionScripts.plugins.as3project::CreateProject/createFileSystemBeforeSave()
: 	at actionScripts.plugins.as3project::CreateProject/createSave()
: 	at flash.events::EventDispatcher/dispatchEvent()
: 	at mx.core::UIComponent/dispatchEvent()
: 	at MethodInfo-25757()
: 	at actionScripts.plugin.settings::SettingsView/save()
: 	at actionScripts.plugin.settings::SettingsView/handleSaveClicked()
:
: Click here to Report a Bug

Maybe we should change that default folder ? I changed location of project straight to C:\ and it went ok. What if we change default location of SDKs to C:\MoonshineSDKs ?

Hm.. So Windows' firewall is preventing file creation inside user's Documents folder. Maybe because the SDK Installer is not a signed application like Moonshine is, and because of its packaging process (captive runtime bundle) we can't use signed installer certificate against it either but self-signed.

If this problem remain then perhaps we should change to other default location. One option to return to File.userDirectory; I'm not very happy about this location nor I'm happy either about C:\ root location.

[EDIT: I think the above error you returned while using Moonshine. So perhaps my signed application theory is not applicable against this case either]

@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Mar 19, 2019

I have added project opening sequence after a repository cloned with Git. This valid as long the project configuration files exists to the root of the downloaded directory. Sub-directories parsing not included in this fix. We can think about providing sub-directories options against project import as we see in Eclipse/Flash Builder, in future.

I have tested by this repository: https://github.com/rat-moonshine/testRepo.

@joshtynjala
Copy link
Collaborator

Maybe because the SDK Installer is not a signed application like Moonshine is, and because of its packaging process (captive runtime bundle) we can't use signed installer certificate against it either but self-signed.

AIR supports signing captive runtime bundles. In fact, as I call, there isn't anything special that you need to do. You use the same command line options with adt to sign them that you would with shared runtime AIR apps.

If you create a custom installer for a captive runtime bundle, you can sign that too, but not with AIR's tooling. For the Feathers SDK Manager and my app Logicly, I use signtool.exe from the Windows SDK to sign the installer. The command looks like this:

signtool.exe sign /f path/to/cert.p12 /p mypassword installer.exe

I use the same code signing certificate (issued from an authority) for the installer that I use when packaging the AIR app.

@rat-moonshine
Copy link
Collaborator Author

rat-moonshine commented Mar 19, 2019

Maybe because the SDK Installer is not a signed application like Moonshine is, and because of its packaging process (captive runtime bundle) we can't use signed installer certificate against it either but self-signed.

AIR supports signing captive runtime bundles. In fact, as I call, there isn't anything special that you need to do. You use the same command line options with adt to sign them that you would with shared runtime AIR apps.

If you create a custom installer for a captive runtime bundle, you can sign that too, but not with AIR's tooling. For the Feathers SDK Manager and my app Logicly, I use signtool.exe from the Windows SDK to sign the installer. The command looks like this:

signtool.exe sign /f path/to/cert.p12 /p mypassword installer.exe

I use the same code signing certificate (issued from an authority) for the installer that I use when packaging the AIR app.

Thank you for the inside @joshtynjala . We have signed certificate (from issuer) to sign our usual applications' installers with adt.

Currently we have plan in place to distribute the 64-bit captive runtime bundle as zip archive (for Windows), as we didn't found any free-tooling to generate the bundle as installer, and adt do not provide any option in-box.

We tried using our signed certificate with captive runtime signing process, but the certificate didn't worked as it was suppose to use against signing installers. So we're continue using self-signed one to generate and sign the captive runtime bundle at this moment.

Do you know about any free-tooling to produce bundle files to installer, @joshtynjala ?

@JoelProminic
Copy link
Contributor

JoelProminic commented Mar 19, 2019

@piotrzarzycki21, I can't reproduce the behavior you are seeing for the Documents folder, either. Moonshine SDK Installer installed all of the SDKs in Documents, and I have been creating new projects in Documents.

I am using a Vagrant VM to test. I see it is running Windows 10.0, Build 10240 (version 1507?).

I found this page describing how to restrict access to the Documents directory. Could you check if you have these settings enabled? I don't even see these interfaces on my machines - it seems my template is out of date.
https://www.windowscentral.com/how-manage-file-access-permissions-apps-windows-10-april-2018-update

UPDATE: I think it is fine to use a directory like C:\MooonshineSDKs as long as we compute that base directory from the user directory - this is closer how I normally install SDKs. I would still like to understand why you are seeing errors for Documents, though, since this could affect the user-selected locations for SDKs or new projects.

@JoelProminic
Copy link
Contributor

I did some tests with the latest Bamboo builds today:

Action Windows OSX
Project -> Build Project Works Works
Project -> Build & Run Works Works
Project -> Build as JavaScript Works Works
Project -> Build & Run as JavaScript Works Works
Project -> Build Release Works Works
Project -> Build with Apache Ant Works Works
Project -> Build with Apache Maven Works Works
Debug -> Build & Debug Works Works
Subversion Hangs - see below Works
Git Failed (#487) Works
Visual Editor Preview Works Works

Testing Subversion on Windows, the action hung with no clear error in Moonshine. From the command line, I saw a popup with this message:

The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem.

I think this is a similar error to #487.

NOTE: Windows showed me firewall alerts on Visual Editor Preview and Build & Debug. However, the user can easily allow access for Moonshine from the prompt, so htis should not be a problem.

rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Mar 20, 2019
@rat-moonshine
Copy link
Collaborator Author

Testing Subversion on Windows, the action hung with no clear error in Moonshine. From the command line, I saw a popup with this message:

The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem.

Perhaps this is more like a system level problem than the distributing SDK or Moonshine problem (?)

I gave some tests. I ensured there is no system environment reference to SVN is present, and using Moonshine with distributing SlikSVN only. To doubly ensure, I also removed my previously installed SlikSVN and TortoiseSVN folders in Program Files from their location.

I tested by one Prominic repository against all three available menu options to 'Subversion'. I confirm I able to perform all three actions without any problem.

@piotrzarzycki21
Copy link
Collaborator

I found this page describing how to restrict access to the Documents directory. Could you check if you have these settings enabled? I don't even see these interfaces on my machines - it seems my template is out of date.
https://www.windowscentral.com/how-manage-file-access-permissions-apps-windows-10-april-2018-update

@JoelProminic Yes I have this settings enabled. Not sure what could that be.
documents

rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Mar 20, 2019
@JoelProminic
Copy link
Contributor

I created a new Windows VM (version 1809) with Vagrant: https://app.vagrantup.com/StefanScherer/boxes/windows_10

I confirmed I had the same access settings for Documents. I also saw per-app restrictions in this interface, but Moonshine and Moonshine SDK Installer were not in the list.
image

The "Virus and Threat Protection" settings were not visible to me with the way the VM was configured. I'll update this comment if I figure out how to confirm the state.

However, I was not able to reproduce the behavior that @piotrzarzycki21 reported:

  • I was able to start Moonshine SDK Installer targeting C:/Users//Documents
  • I was able to create projects in C:/Users//Documents

I was also not able to reproduce the Project Sidebar issue (#482) in my initial testing.

I confirmed that the default SDK installation directory is C:/MoonshineSDKs. The installation process completed with no errors, and everything was setup like I expected.

@piotrzarzycki21
Copy link
Collaborator

I'm closing that one cause we have released Moonshine. Any additional stuff should be covered into separate issues or in SDK Installer repository if needed.

Moonshine-IDE - Features automation moved this from To Do to Done #2.0.0 Mar 25, 2019
rat-moonshine added a commit to Moonshine-IDE/Moonshine-SDK-Installer that referenced this issue Apr 17, 2019
joshtynjala added a commit that referenced this issue Dec 10, 2020
… it is being used by another process error on Windows (references #449)

Fixed by using synchronous file APIs isntead of asynchronous. Determined that even after Event.CLOSE is dispatched by the FileStream, the file may still be considered in use. If opened synchronously instead, file appears to be completely closed immediately after calling close().

Even with the 1 second delay between calls, the being used by another process error could still appear. This started happening more frequently when calling java -version before starting language servers, if Moonshine opened with multiple projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants