Page 1 of 2

Problem testing an MS Office 2010 package

Published: April 26, 2016 - 3:01 PM
by SergieTrunk
Good morning,
I'm creating a new topic even though one already exists, but I'm a complete beginner in Python, and from what I understand, the code needs to be modified depending on our specific situations. Therefore, I would appreciate some clarification.
So first, I created an MS Office 2010 template with the setup.exe file. When I double-click on it without WAPT, it performs a silent installation of the MS Office suite. Using the folder created with `wapt-get make-template`, I tried `wapt-get install`, but I encountered the following problem:
Picture

Code: Select all

C:\Users\Administrateur>wapt-get install C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
Installing WAPT file C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
installing ARS-microsoftsetupbootstrapper
2016-04-26 11:54:37,994 CRITICAL Fatal error in install script: CalledProcessError: Command '('"setup.exe" /VERYSILENT',)' returned non-zero exit status 2:
Traceback (most recent call last):
  File "C:\wapt\common.py", line 3178, in install_wapt
    exitstatus = setup.install()
  File "C:\waptdev\ARS-microsoftsetupbootstrapper-wapt\setup.py", line 8, in install
    run(r'"setup.exe" /VERYSILENT')
  File "C:\wapt\common.py", line 3025, in run
    return setuphelpers.run(*arg,pidlist=self.pidlist,**args)
  File "C:\wapt\setuphelpers.py", line 1020, in run
    raise subprocess.CalledProcessError(proc.returncode,cmd,''.join(output))
CalledProcessError: Command '('"setup.exe" /VERYSILENT',)' returned non-zero exit status 2

FATAL ERROR : CalledProcessError: Command '('"setup.exe" /VERYSILENT',)' returned non-zero exit status 2
I read that I need to add lines of code to check if the program isn't already installed, the license activated, etc. The problem is, I don't know which file to look in. In waptdev, I have four files: setup.py, setup.exe, control, and wapt.psproj
I tried to download an MS Office 2013 package from theantsoftheweb I tried to compare the files but I don't see any difference, and the installation doesn't work either.
I also tried with an .msi file (excel, word...) but I got another error (code 1603).
I work on a Windows Server 2012 R2 under VMware, I also have 2 Win7 (physical) workstations at my disposal.
If someone could even just point me in the right direction, it would be of great help.
THANKS ;)

Re: Problem testing an MS Office 2010 package

Published: April 26, 2016 - 3:21 PM
by sfonteneau
Can you send your setup.py file?

I don't see any line with the msp file:

Code: Select all

'"setup.exe" /adminfile "silent.msp"'

Re: Problem testing an MS Office 2010 package

Published: April 26, 2016 - 3:59 PM
by SergieTrunk

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

def install():
    print('installing ARS-microsoftsetupbootstrapper')
    run(r'"setup.exe" /VERYSILENT')
I haven't changed anything in it; the silent installation happens automatically with setup.exe without wapt.

Re: Problem testing an MS Office 2010 package

Published: April 26, 2016 - 4:35 PM
by sfonteneau
In this case you can remove VERYSILENT

In my opinion, this is a parameter not supported by setup.exe


In any case, to be sure, you can use the Windows command line to run:

Code: Select all

cd C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
Then one:

Code: Select all

setup.exe /VERYSILENT
But in my opinion, that won't work.

However, just a setup.exe will work

Explanation :
During the make-template process, wapt will automatically add /VERYSILENT for an executable file because it's a fairly standard flag for executables. However, sometimes this flag doesn't work, so you'll need to modify it and edit the setup.py file to make it work.

Re: Problem testing an MS Office 2010 package

Published: April 27, 2016 - 9:35 AM
by SergieTrunk
I'm still getting the same message. I modified setup.py as follows:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

def install():
    print('installing ARS-microsoftsetupbootstrapper')
    run("setup.exe")

Re: Problem testing an MS Office 2010 package

Published: April 27, 2016 - 11:49 AM
by sfonteneau
Not to mention wapt:

What does a: return?

Code: Select all

cd C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
Then :

Code: Select all

setup.exe 
?

If that doesn't work, could you try the first method I suggested?

Windows command line:

Code: Select all

setup.exe /adminfile silent.msp
Line for setup.py:

Code: Select all

cmd = '"setup.exe" /adminfile "silent.msp"'
run(cmd,timeout=1200,accept_returncodes=[1641,3010,0])

Place the silent.msp file next to setup.exe.

Re: Problem testing an MS Office 2010 package

Published: April 28, 2016 - 5:00 PM
by SergieTrunk
Good morning,
So I tried to navigate to the directory and then run setup.exe /VERYSILENT from the command line, but the error message I showed in the image in my first message still appears.
So I tried

Code: Select all

setup.exe /adminfile silent.msp
always in the same directory, and always the same error message.
After modifying my setup.py

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []
def install():

cmd = '"setup.exe" /adminfile "silent.msp"'
run(cmd,timeout=1200,accept_returncodes=[1641,3010,0])
When I go through WAPT, I get the following error

Code: Select all

C:\Users\Administrateur>wapt-get install C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
Installing WAPT file C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
2016-04-28 16:27:23,549 CRITICAL Error importing C:\waptdev\ARS-microsoftsetupbootstrapper-wapt\setup.py :
Traceback (most recent call last):
  File "C:\wapt\common.py", line 644, in import_setup
    py_mod = imp.load_source(modulename, setupfilename)
  File "C:\waptdev\ARS-microsoftsetupbootstrapper-wapt\setup.py", line 7
    cmd = '"setup.exe" /adminfile "silent.msp"'
      ^
IndentationError: expected an indented block

FATAL ERROR : IndentationError: expected an indented block (setup.py, line 7)

Re: Problem testing an MS Office 2010 package

Published: April 28, 2016 - 6:41 PM
by sfonteneau
You have an indentation error:

You need to move it below def install

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []
def install():

   cmd = '"setup.exe" /adminfile "silent.msp"'
   run(cmd,timeout=1200,accept_returncodes=[1641,3010,0])

Re: Problem testing an MS Office 2010 package

Published: April 29, 2016 - 09:58
by SergieTrunk
Good morning,
Thank you, indeed I have just corrected it.
I keep getting the same error message:

Code: Select all

C:\Users\Administrateur>wapt-get install C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
Installing WAPT file C:\waptdev\ARS-microsoftsetupbootstrapper-wapt
2016-04-29 09:56:53,063 CRITICAL Fatal error in install script: CalledProcessError: Command '('"setup.exe" /adminfile "silent.msp"',)' returned non-zero exit status 2:
Traceback (most recent call last):
  File "C:\wapt\common.py", line 3178, in install_wapt
    exitstatus = setup.install()
  File "C:\waptdev\ARS-microsoftsetupbootstrapper-wapt\setup.py", line 8, in install
    run(cmd,timeout=1200,accept_returncodes=[1641,3010,0])
  File "C:\wapt\common.py", line 3025, in run
    return setuphelpers.run(*arg,pidlist=self.pidlist,**args)
  File "C:\wapt\setuphelpers.py", line 1020, in run
     raise subprocess.CalledProcessError(proc.returncode,cmd,''.join(output))
CalledProcessError: Command '('"setup.exe" /adminfile "silent.msp"',)' returnednon-zero exit status 2

FATAL ERROR : CalledProcessError: Command '('"setup.exe" /adminfile "silent.msp"',)' returned non-zero exit status 2

Re: Problem testing an MS Office 2010 package

Published: April 29, 2016 - 1:13 PM
by sfonteneau
If I'm not mistaken, exit 2 generally corresponds to:

The system cannot find the file specified. Indicates that the file cannot be found in the specified location.


http://www.symantec.com/connect/article ... escription

Is setup.exe present in C:\waptdev\ARS-microsoftsetupbootstrapper-wapt?

Is silent.msp present in C:\waptdev\ARS-microsoftsetupbootstrapper-wapt?

I also advise you to test with the --direct option:
viewtopic.php?f=9&t=447#p990