I probably misunderstood. You run the installer manually once to generate 
the iss file right? And then on subsequent installs you can reference the 
iss to have a unattended installation?

In any case, the following should probably also work:
 arguments: "-s -f1 setup.iss"

My point is simply that although you tell PowerShell about files in the 
current dir by using dot-slash notation (.\file.iss) that's not meaning you 
should use the same format when telling setup.exe about the same file's 
direction. PowerShell will just send whatever arguments you supply to the 
installer, which is why dot-slash won't work.

Glad you got it working.

On Thursday, February 18, 2016 at 12:42:16 AM UTC+1, Gerald Spencer wrote:
>
> Interestingly enough, the absolute path with forward slashes did the 
> trick. The normal setup isn't created, but everything appears to be working 
> as it should. Thanks!
>
> On Wednesday, February 17, 2016 at 9:51:50 AM UTC-8, Gerald Spencer wrote:
>>
>> When the appropriate command line format for the reference file is 
>> supplied, the installer creates a setup.txt in the installers directory 
>> with various other information. Unfortunately, using the an absolute path 
>> with forward or back slashes does not appear to work for the ansible 
>> arguments as no setup.txt is created.
>>
>>  
>> On Wednesday, February 17, 2016 at 9:40:58 AM UTC-8, Trond Hindenes wrote:
>>>
>>> Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
>>> "dot-backslash" approach when using the shell interactively, but that 
>>> doesn't mean you should do the same when supplying absolute/relative paths 
>>> to the ansible module. Also, PowerShell supports forward slashes, so feel 
>>> free to use them instead, so you don't have to escape them.
>>>
>>> I would assume you would use something like:
>>>
>>> - name: install software
>>>   win_package:
>>>     path: "C:/Users/UserName/Desktop/Software/setup.exe"
>>>     product_id: {guid}
>>>     arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' 
>>> (i added a space between the last double-quote and single-quote just for 
>>> clarification. Should probably be removed in prod)
>>>
>>>
>>> On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer 
>>> wrote:
>>>>
>>>> After further poking around after the win_package is parsed out to the 
>>>> windows machine. Every backslash that is entered into the arguments is 
>>>> doubled for the $complex_args variable in the powershell script that is 
>>>> ran 
>>>> on the windows machine. 
>>>>
>>>> So 
>>>>
>>>>    - "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
>>>>    - "-s -f1".\\setup.iss" becomes "-s -f1".\\\\setup.iss" 
>>>>    - "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" 
>>>>    becomes "-s 
>>>>    -f1"C:\\\\Users\\\\UserName\\\\Desktop\\\\Software\\\\setup.iss"" 
>>>>    
>>>> I even set an enviroment variable for the full path of setup.iss and 
>>>> tried to invoke it with 
>>>>
>>>>    - "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
>>>>    single quote required to evaluate a variable in a double quote of a 
>>>> .ps1)
>>>>    
>>>> Unfortunately, this did not work with win_package. Though it did work 
>>>> when I created a quick script on the local machine for testing. It seems 
>>>> to 
>>>> me that the win_package parses the argument string in an odd way. 
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/194c0db4-b227-4784-9a84-016d5ae74dda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to