If users download the software, they don't have to visit your site and go to Amazon site directly with your affiliate links on the software. Is it allowed?
Don't think of writing such a software. It's not only illegal, it is both unethical, fraudulent and it's generally considered a spyware. Amazon will close your account in a flash.
This is not a legal advice just my thoughts: My understanding is that if the user clicks on a link within your software it should be allowed. However if your software is stuffing the tag to unsuspecting users, then this should be highly illegal. There was a Firefox plugin that used to do that and of course it got shutdown.
The only way to know for sure is to clarify it with Amazon directly somehow. But if you feel like you can't explain it to Amazon... then it is obviously illegal. I can see a way where it *should* be allowed. For example some kind of eBook reader that links to Amazon for more eBooks, or an MP3 player software that shows Amazon ads. But somehow I don't think this is what your talking about...