Jump to content

"This app can't run on your PC" Windows 10 message


LisHawj
 Share

Recommended Posts

I have a compiled Office 2016 Click2Run script that deploys the Microsoft Office suite to our employees.  The compiled script deploying the older version of Office runs perfectly on Windows 10 1803 and 1809.  After downloading the current version of Office 2016 using the Office Deployment Tool I updated the script and Windows 10 is kicking up "This app can't run on your PC."  All I changed was the version directory name to point to the current version of Office 2016. The compiled script is signed using our in-house Certificate Authority certificate.  The previous version of the compiled script run fine on the same two test PCs without any issue.  Again, no change was made to the script outside of redirecting the source directory used with FileInstall.  Both the previous and current script use FileInstall to package the Office installer into a single executable.  What could be causing the updated compiled script to cause Windows 10 to kick up "This app can't run on your PC."

I have done the following troubleshooting:

1. Disable Window Defender via registry key setting all appropriate keys to a value of 1.
2. Disable Windows SmartScreen for Apps and Files, Edge Browser, and Microsoft Store.
3. No other anti-virus program is installed.
4. Compiled the script from within SciTE and separately with Aut2Exe.
5. No UPX setting is enabled
6. Uninstalled and reinstalled both Autoit and SciTE.

Need help!

#RequireAdmin
_WinAPI_Wow64EnableWow64FsRedirection(False)
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <WinAPIFiles.au3>
#include <ExtMsgBox.au3>
$sSetup = "C:\Clean\Install\Setup.exe "
$sCS = "C:\Clean\Install\Success.txt"
$sCR = "C:\Clean\Install\Restart.txt"
$sConfigure = "/Configure "
$sConfig_file = "C:\Clean\Install\BusinessUpdates.xml"
$sOutlook = "C:\Program Files (x86)\Microsoft Office\root\Office16\Outlook.exe"
$sWscript = "C:\Clean\Install\OffScrubC2R_212.vbs"
$sLog = "/Log C:\Clean\log.txt"
$sOffice_dir = "C:\Clean\Install\Office\Data\16.0.10730.20264\"
$sPbar = "C:\Clean\Install\Extractor.exe"

If Not FileExists("C:\Clean" & "\Install\Office\Data\16.0.10730.20264\") Then
    Do
        DirCreate("C:\Clean" & "\Install\Office\Data\16.0.10730.20264\")
    Until FileExists("C:\Clean" & "\Install\Office\Data\16.0.10730.20264\")
EndIf
If Not FileExists($sPbar) Then
    FileInstall("C:\Install\Extractor.exe", "C:\Clean" & "\Install\", 1) ;Extract the progress bar.
Else
    Sleep(10)
EndIf
$hTC_hWnd = Run($sPbar)

If Not FileExists("C:\Clean\Install\Office\Data\16.0.10730.20264\stream.x86.x-none.dat") Then
    FileInstall("C:\Install\BusinessUpdates.xml", "C:\Clean" & "\Install\", 1)
    FileInstall("C:\Install\o15-ctrremove.diagcab", "C:\Clean" & "\Install\", 1)
    FileInstall("C:\Install\OffScrubC2R_212.vbs", "C:\Clean" & "\Install\", 1)
    FileInstall("C:\Install\setup.exe", "C:\Clean" & "\Install\", 1)
    FileInstall("C:\Install\Uninstallconfig.xml", "C:\Clean" & "\Install\", 1)
    FileInstall("C:\Install\Office\Data\v32.cab", "C:\Clean" & "\Install\Office\Data\", 1)
    FileInstall("C:\Install\Office\Data\v32_16.0.10730.20264.cab", "C:\Clean" & "\Install\Office\Data\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\i320.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\i640.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\i321033.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\i641033.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\s320.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\s321033.cab", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\stream.x86.en-us.dat", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    FileInstall("C:\Install\Office\Data\16.0.10730.20264\stream.x86.x-none.dat", "C:\Clean" & "\Install\Office\Data\16.0.10730.20264\", 1)
    ProcessClose($hTC_hWnd)
    MsgBox(0, "", "File(s) extraction completed!", 2)
Else
    ProcessClose($hTC_hWnd)
EndIf

$CnI_GUI = GUICreate("Office 365/2016 Clean and Install", 427, 145, -1, -1)
$Label1 = GUICtrlCreateLabel("Select a task and click Run.", 61, 8, 311, 22, $SS_CENTER)
GUICtrlSetFont(-1, 11, 400, 0, "Calibri")
$Button1 = GUICtrlCreateButton("Run", 180, 104, 75, 35)
$Label2 = GUICtrlCreateLabel("Run Office Cleaner/Scrubber", 42, 44, 358, 17)
GUICtrlSetFont(-1, 10, 800, 0, "Calibri")
$Label3 = GUICtrlCreateLabel("Run Office Installer", 42, 68, 358, 15)
GUICtrlSetFont(-1, 10, 800, 0, "Calibri")
$Radio1 = GUICtrlCreateRadio("", 24, 44, 15, 17)
$Radio2 = GUICtrlCreateRadio("", 24, 68, 15, 17)
GUISetState(@SW_SHOW)
GUICtrlSetState($Radio1, $GUI_CHECKED)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ;DirRemove("C:\Clean", 1)
            Exit
        Case $Button1
            GUISetState(@SW_MINIMIZE, $CnI_GUI)
            While 1
                _Disable()
                If GUICtrlRead($Radio1) = $GUI_CHECKED Then
                    $iReturn = MsgBox(1, "Office 365/2016 Clean and Install", "The following Office programs " & _
                            "(if running) will be forced closed for the cleaning process to run correctly." & @CRLF & @CRLF & _
                            "Microsoft Internet Explorer" & @CRLF & _
                            "Microsoft Excel" & @CRLF & _
                            "Microsoft Access" & @CRLF & _
                            "Microsoft Outlook" & @CRLF & _
                            "Microsoft PowerPoint" & @CRLF & _
                            "Microsoft Word" & @CRLF & _
                            "Microsoft Skype for Business" & @CRLF & _
                            "Microsoft OneNote" & @CRLF & _
                            "Microsoft OneDrive" & @CRLF & @CRLF & _
                            "Please save your work, close the programs, and then click the 'OK' button to continue. Otherwise click 'Cancel' to exit or to go back.")
                    Select
                        Case $iReturn = 1
                            ProcessClose("iexplore.exe") ;Kill Internet Explorer process
                            ProcessClose("excel.exe") ;Kill Excel process
                            ProcessClose("msaccess.exe") ;Kill Access process
                            ProcessClose("outlook.exe") ;Kill Outlook process
                            ProcessClose("powerpnt.exe") ;Kill PowerPoint process
                            ProcessClose("winword.exe") ;Kill Word process
                            ProcessClose("lync.exe") ;Kill Skype process
                            ProcessClose("onenote.exe") ;Kill OneNote process
                            ProcessClose("onenotem.exe") ;Kill OneNote Tool process
                            ProcessClose("onedrive.exe") ;Kill OneDrive process
                            Sleep(2000)
                            If FileExists($sOutlook) Then
                                _RunScrubber()
                            ElseIf Not FileExists($sOutlook) Then
                                MsgBox(64, "Office 365/2016 installation", "There is no existing Office 365/2016 installation detected on this PC." & @CRLF & @CRLF & _
                                        "Click OK to go back and select Run Office Installer.")
                                _Enable()
                                GUISetState(@SW_RESTORE, $CnI_GUI)
                                ExitLoop
                            EndIf
                        Case $iReturn = 2
                            GUISetState(@SW_RESTORE, $CnI_GUI)
                            _Enable()
                            ExitLoop
                    EndSelect
                ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then
                    GUISetState(@SW_MINIMIZE, $CnI_GUI)
                    If FileExists($sOutlook) Then
                        $iReturn = MsgBox(65, "Office 365/2016 installation", "An existing Office 365/2016 installation is detected on this PC." & @CRLF & @CRLF & _
                                "Click OK to reinstall Office, otherwise click Cancel to go back.")
                        Select
                            Case $iReturn = 1
                                _RunOInstall()
                            Case $iReturn = 2
                                _Enable()
                                GUISetState(@SW_RESTORE, $CnI_GUI)
                                ExitLoop
                        EndSelect
                    Else
                        _RunOInstall()
                    EndIf
                EndIf
            WEnd
    EndSwitch
WEnd

Func _RunScrubber()
    $iPID = ShellExecute($sWscript, $sLog, "")
    While 1
        If FileExists("C:\Clean\Install\Success.txt") Then
            $iReturn = MsgBox(65, "Office 365/2016 installation", "The Office clean/scrub process completed successfully, and a restart is not required." & @CRLF & @CRLF & _
                    "Click OK to install Office 2016, otherwise click Cancel to exit to Windows.")
            Select
                Case $iReturn = 1
                    _RunOInstall()
                Case $iReturn = 2
                    Exit
            EndSelect
        ElseIf FileExists("C:\Clean\Install\Restart.txt") Then
            RegWrite("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "OfficeInstall", "REG_SZ", $sSetup & $sConfigure & $sConfig_file)
            FileDelete($sCS)
            FileDelete($sCR)
        Else
            Sleep(500)
        EndIf
    WEnd
EndFunc   ;==>_RunScrubber

Func _RunOInstall()
    $iPID = Run($sSetup & $sConfigure & $sConfig_file)
    Sleep(3000)
    If WinExists("‪Couldn't install‬") Then
        MsgBox(64,"Office 365/2016 installation", "Microsoft Office could not install onto the PC." & @CRLF & "Possible causes are:" & @CRLF & @CRLF & _
                "1. The config XML file has the wrong source location." & @CRLF & _
                "2. The v32.cab file is an older file or is corrupt." & @CRLF & _
                "3. The setup.exe file is an older file or is corrupt." & @CRLF & _
                "4. Check access to the install source is not blocked." & @CRLF & _
                "5. One or more C2R deployment files are missing.")
    Else
        Sleep(100)
    EndIf
    FileDelete($sCS)
    FileDelete($sCR)
    Exit
EndFunc   ;==>_RunOInstall

Func _Enable()
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetState($Radio1, $GUI_ENABLE)
    GUICtrlSetState($Radio2, $GUI_ENABLE)
EndFunc   ;==>_Enable

Func _Disable()
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetState($Radio1, $GUI_DISABLE)
    GUICtrlSetState($Radio2, $GUI_DISABLE)
EndFunc   ;==>_Disable

 

Edited by LisHawj
Link to comment
Share on other sites

@LisHawj

Did you check to make sure that you weren't trying to run 64-bit executables (compiled script or installer) on a 32-bit OS?

Edited by TheXman
Link to comment
Share on other sites

Our environment is strictly 64-Bit and so both the Windows OS and Office installation is x64.  The script is compiled in x64 as well using both SciTE and Aut2exe.  This issue is baffling to me because the old x64 compiled script I created months ago works just fine on the test machines that are refusing to execute the newly updated script.  Again, only folder redirection with FileInstall was made and nothing else has changed.

Link to comment
Share on other sites

Thank you for the input.  As previously stated, I have disabled Windows Defender on the test PCs, disabled Smartscreen, and there is no other Anti-virus running.  I am in the process of re-downloading the Office C2R files with ODT.  Maybe a file or two is corrupted in the first download attempt.

Link to comment
Share on other sites

1 hour ago, LisHawj said:

I1. Disable Window Defender via registry key setting all appropriate keys to a value of 1.

If you disable the antivirus software via REG key you will need to reboot so that the antivirus program stops running.
But to be fast and sure, you need to access the security center and check if the antivirus program has been disabled or NOT.

With antivirus program will activate automatically after rebooting!

Regards,
 

Link to comment
Share on other sites

Anti-virus is disabled via registry to prevent it from automatically coming back after a reboot.  I have verified Windows Defender is truly turned off on the test PCs.  The message reads "Your Virus & threat protection is managed by your organization."  These are two stand-alone PCs not connected to our domain and freshly imaged with Windows 10 1803 and 1809.  I just completed recompiling the older Office C2R install files and had no problem running the script on the test PCs, so I am beginning to believe the new files may be corrupted.  I will know if it is corruption related after the download is completed.

Link to comment
Share on other sites

I have re-download the Office C2R setup files twice and still getting the same Windows pop-up "This app can't run on your PC.  To find a version for your PC, check with the software publisher."  Is there a file size limitation with FileInstall?  The previous re-compiled and working version is 1.8GB, but the newest version of Office C2R compiled is 2.6GB.  If the script is not compiled, then it runs perfectly.  I am at a lost now.  I cleared all Windows event viewer logs, kicked off the compiled script, and no event is logged.

I have added the code I wrote to my original post.  Hopefully someone smarter than me can help resolve this issue for me.

Link to comment
Share on other sites

Filecopy is not a viable option.  This script is used by remote/telecommuter employees with no technical support on-site.  The script must include all relevant Office C2R files in a single .exe file that decompresses the Office C2R files and kick off the installation.  I have isolated the issue to the Office C2R file "stream.x86.x-none.dat" at 1.9GB or its equivalent x64 counterpart.  The script run and decompresses perfectly if the file mentioned is not included in the script.  Compiling the script with just the single big DAT file also produces the error I mentioned.  All of this seem to point to a file size limitation with FileInstall.  Can someone with more knowledge on FileInstall confirm it is a file size limitation?  I have a large project of nearly 800 remote PCs that must be upgraded by remote employees.  If FileInstall is not the way to go, then I am looking for alternatives within the scope and function of Autoit.  Otherwise, I may have to explore a solution outside of AutoIt.

Thank you.

Link to comment
Share on other sites

  • Developers

How are you pushing the file to the remote user? The way I've done it in the past is use SCCM to push the installer and the compiled script to the remote PC's and then shell the script to do the work. 

Not sure whether there is a size limitation to the program's resources but 2.6 Gb is pretty big and one mistake in the script and you need to transfer that whole big file again, while when you have the script separate, who only have to send an update for that.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

SCCM is perfect for this, if you have it in your environment; you can even throttle the bandwidth if your users are on slow connections. Have done that a number of times to push out things like CAD.

If SCCM is not an option, and you are delivering it to them "over the wire" as opposed to some sort of digital media sent snail mail, you may want to look into the throttling options of Robocopy. It is ugly, but it works in a pinch.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Use SFX installer (7z/ WinRAR/..)! It UnCompress the Setup file with your program,

After extracting ends, it  automatically will run your program and start the installation process automatically according to your script.

Regards,
 

Link to comment
Share on other sites

The file is pushed to remote employees that are constantly on the go (aka road warriors) via snail mail on an encrypted USB drive.  I have tried to use SCCM, but most of our remote employees do not stay logged on via VPN long enough for the massive file to push completely onto their PC.  In the past this resulted in less than 35% of them ever getting the newest version of Office.  I had a huge success with 100% installation when I moved to pushing the installation via snail mail with the previous working version.  Now, I am stuck again and may have to try using SCCM once more or send two files on a USB drive (the big DAT file unpackaged with the script .exe file).

Link to comment
Share on other sites

  • Developers

So I really don't see the issue putting 2 files on the USB drive or am I missing something?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

In the past, a small handful of creative employees have tried to replace the Office C2R files with files they received elsewhere when I sent out the script and the unpackaged Office C2R files.  The script main purpose is to ensure the integrity of the original files.  Hence, the script is also signed with our in-house software deployment certificate. 

But at this point, I think two files may not be that big an issue considering all the other security endpoints we have in place.

Edited by LisHawj
Link to comment
Share on other sites

  • Moderators

@LisHawj I ran into the same issue with a customer once, had road warriors on satellite connections. One, I recall, was living literally in the middle of a corn field in the southern part of the US. I did the same thing; sent the Office files on a thumb drive. But I did not include a couple of the .dlls - those I pushed with SCCM. It prevented users from walking off with a copy of office, and the push was only a couple hundred KB.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Glad to help; a bit further on it, I included an AutoIt script on the thumb drive that would copy all the necessary Office files to the path I wanted. Told the users (at that time all local admins) to simply run the executable and then return the thumb drive or wipe it.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...