Well there may be a couple of issues.

1 - you should probably add a bit more error checking and what-if code such as if the file does not get written for some reason even if the installer did install it already it will keep installing it.

2 - Normally users would not have rights to install software on their own system