Moonshine-IDE / Moonshine-SDK-Installer

To take full advantage of Moonshine IDE you will need third party SDKs like Apache® Flex or Apache® Royale. In order to make it easier for you to setup the required SDKs, we created the Moonshine SDK Installer.
https://moonshine-ide.com/download-sdk-installer/
Other
8 stars 2 forks source link

Flex SDK Installs Fail on Expand-Archive Error #87

Closed JoelProminic closed 2 years ago

JoelProminic commented 2 years ago

Once I test by the reverted 33.1.1.713 download, I matched @JoelProminic 's error:

Installer path: C:\Program Files\MoonshineSDKInstaller
Installer version 4.2.0 (windows)
Available Memory: 40591360 (64-bit)
Using Locale: en_IN
Fetched the SDK download mirror URL from the CGI.
Creating Apache Flex home
Creating temporary directory
Downloading Apache Flex SDK from: https://dlcdn.apache.org/flex/4.16.1/binaries/apache-flex-sdk-4.16.1-bin.zip
Verifying Apache Flex SDK MD5 Signature
The Apache Flex SDK MD5 Signature of the downloaded files matches the reference. The file is valid.
Uncompressing: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1\temp\apache-flex-sdk-4.16.1-bin.zip
Finished uncompressing: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1\temp\apache-flex-sdk-4.16.1-bin.zip
Preparing build script run
Preparing script for Apache Flex SDK
Found script file: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1\installer.xml
Running script by: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1\installer.xml
Downloading Adobe AIR Runtime Kit for Windows from: https://airsdk.harman.com/api/versions/33.1.1.713/sdks/AIRSDK_Flex_Windows.zip?license=accepted
Uncompressing C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/in/AIRSDK_Flex_Windows.zip?license=accepted
Finished uncompressing: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/in/AIRSDK_Flex_Windows.zip?license=accepted
Installing Adobe Flash Player playerglobal.swc from: https://fpdownload.macromedia.com/get/flashplayer/updaters/32//playerglobal32_0.swc
Validating download: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/frameworks/libs/player/28.0/playerglobal.swc
Downloading 2.2.zip from: https://moonshine-ide.com/downloads/swfobject/swfobject/archive
Validating download: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/in/swfobject_2_2.zip
Download complete
Downloading OSMF2_0.swc?format=raw from: https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/frameworks/libs
Validating download: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/frameworks/libs/osmf.swc
Expand-Archive : .swc is not a supported archive file format. .zip is the only supported archive file format.
At line:1 char:107
+ ... yContinue) {Expand-Archive -Path "C:\MoonshineSDKs\Flex_SDK\Flex_4.16 ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (.swc:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive

Originally posted by @rat-moonshine in https://github.com/Moonshine-IDE/Moonshine-SDK-Installer/issues/86#issuecomment-1028775614

I found that the osmf.swc error also triggers with the AIR 32.0 install: image

So it looks like this is a separate issue from the AIR update. I'll create a quick issue for this.

_Originally posted by @JoelProminic in https://github.com/Moonshine-IDE/Moonshine-SDK-Installer/issues/86#issuecomment-1029243522

JoelProminic commented 2 years ago

I tested with the last stable release of MSDKI (4.1.1), and I did not get the above error. The osmf.swc URL was the same, so this is not a chance with the downloaded file.

To avoid the Expand-Archive error, you can to copy or rename the file to end in .zip. I tried using the -Force option instead, but that got the same error reported above.

rat-moonshine commented 2 years ago

Following the investigation, it looks like following <unzip/> process creates trouble after downloading/validating osmf.swc:

From SDK's installer.xml:

<target name="osmf-download" depends="osmf-check" unless="skip.osmf.install"
        description="Copies OSMF from Open@Adobe">

        <echo file="${basedir}/osmf.properties">osmf.echo=${INFO_DOWNLOADING_FILE_FROM}</echo>
        <replace file="${basedir}/osmf.properties" token="{0}" value="${osmf.url.file}" />
        <replace file="${basedir}/osmf.properties" token="{1}" value="${osmf.url.server}/${osmf.url.folder}" />
        <property file="${basedir}/osmf.properties" />
        <delete file="${basedir}/osmf.properties" />
        <echo>${osmf.echo}</echo>

        <mkdir dir="${basedir}/frameworks/libs/"/>
        <antcall target="download_using_get" >
            <param name="srcDomain" value="${osmf.url.server}" />
            <param name="srcFolder" value="${osmf.url.folder}" />
            <param name="srcFile" value="${osmf.url.file}" />
            <param name="cacheFile" value="${osmf.url.cachefile}" />
            <param name="dest" value="${basedir}/frameworks/libs/osmf.swc" />
            <param name="failmessage" value="OSMF download failed" />
            <param name="md5" value="${osmf.url.md5}" />
        </antcall>

        <unzip src="${basedir}/frameworks/libs/osmf.swc" dest="${download.dir}">
            <patternset>
                <include name="library.swf"/>
            </patternset>
        </unzip>
        <copy file="${download.dir}/library.swf" tofile="${FLEX_HOME}/frameworks/rsls/osmf_${flex-sdk-description.version}.${flex-sdk-description.build}.swf" />
    </target>

The error was:

Downloading OSMF2_0.swc?format=raw from: https://sourceforge.net/adobe/flexsdk/code/HEAD/tree/trunk/frameworks/libs
Validating download: C:\MoonshineSDKs\Flex_SDK\Flex_4.16.1_AIR_33.1/frameworks/libs/osmf.swc
Expand-Archive : .swc is not a supported archive file format. .zip is the only supported archive file format.
At line:1 char:107
+ ... yContinue) {Expand-Archive -Path "C:\MoonshineSDKs\Flex_SDK\Flex_4.16 ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (.swc:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive

I never seen this error but recently.

@joshtynjala does your last changes to Ant unzip API with PowerShell could reflect to this above error: https://github.com/Moonshine-IDE/Moonshine-SDK-Installer/blob/master/flex-utilities/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as#L148. Please, suggest.

joshtynjala commented 2 years ago

Yes, it seems that PowerShell does not like when a .zip file has a different file extension. That's unfortunate. Perhaps Unzip.as should be updated to use the old method when the file extension is not .zip.

rat-moonshine commented 2 years ago

Yes, Okay. I just wanted to have a confirmation from you first, thank you @joshtynjala .

rat-moonshine commented 2 years ago

The original problem in the issue seems to be working Okay now (tested using Harman AIR SDK v33.1.1.713), I'm closing this issue now.