Thanks, Maxime! :)
I tested the code, and it works.
But this is not what I exactly wanted.
As I mentioned, the problem is that some users are installing C4D in a custom directory and I can't find preferences path nor an actual installation path.
I also tried os.walk() Method to find MAXON directory, but it has two significant problems.
- It's too slow
- there are several folders called MAXON
The only thing that users can define is the release number, and I have to find it according to the string, for example, "R20".
Here is how the installer works.
It works on most of the computers but some users already reported that it can't find their directory so they are forced to manually define it but most of them are defining global directory. If you remember, I had to remove symbolcache file and this is one of the reasons why I made this installer.