Problem testing an MS Office 2010 package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
SergieTrunk
Messages: 9
Registration: Apr 26, 2016 - 09:51

April 26, 2016 - 3:01 PM

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 ;)
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 26, 2016 - 3:21 PM

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"'
SergieTrunk
Messages: 9
Registration: Apr 26, 2016 - 09:51

April 26, 2016 - 3:59 PM

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.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 26, 2016 - 4:35 PM

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.
SergieTrunk
Messages: 9
Registration: Apr 26, 2016 - 09:51

April 27, 2016 - 9:35 AM

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")
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 27, 2016 - 11:49

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.
SergieTrunk
Messages: 9
Registration: Apr 26, 2016 - 09:51

April 28, 2016 - 5:00 PM

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)
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 28, 2016 - 6:41 PM

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])
SergieTrunk
Messages: 9
Registration: Apr 26, 2016 - 09:51

April 29, 2016 - 09:58

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
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

April 29, 2016 - 1:13 PM

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
Locked