Page 1 of 1

UTF8 encoding and software uninstallation

Published: July 25, 2019 - 09:26
by skoizer
Good morning,
wapt 1.6.2.7
I need to uninstall DWG TrueView 2018 software, but the directory contains special characters

I put this at the beginning, then

Code: Select all

# -*- coding: utf-8 -*-
the code

Code: Select all

def uninstall():
    print('uninstalling dwg trueview 2018')
run(u'"c:\Program Files\Autodesk\DWG TrueView 2018 - Français (French)\Setup\fr-FR\Setup\Setup.exe".decode("utf-8").encode("cp1252") /P {28B89EEF-1028-040C-0100-CF3F3A09B77D} /R AOEM /language fr-FR /q')
I can't find the correct syntax in the run with a path containing special characters.

here is the error

Code: Select all

CalledProcessErrorOutput: Command '"c:\\Program Files\\Autodesk\\DWG TrueView 2018 - Fran\xc3\xa7ais (French)\\Setup\x0cr-FR\\Setup\\Setup.exe" /P {28B89EEF-1028-040C-0100-CF3F3A09B77D} /R AOEM /language fr-FR /q' returned non-zero exit status 1.
Output:Le chemin d'accŠs sp‚cifi‚ est introuvable.
I tried with double sides, single sides, etc.

I have the same problem

Any ideas on the syntax?

I used this post as a guide: viewtopic.php?t=29

Re: UTF8 encoding and software uninstallation

Published: July 25, 2019 - 10:08 AM
by htouvet
Perhaps by adding an "r" before the string, because there are backslashes in the string that should not be interpreted.

Code: Select all

def uninstall():
    print('uninstalling dwg trueview 2018')
run(ur'"c:\Program Files\Autodesk\DWG TrueView 2018 - Français (French)\Setup\fr-FR\Setup\Setup.exe" /P {28B89EEF-1028-040C-0100-CF3F3A09B77D} /R AOEM /language fr-FR /q')

Re: UTF8 encoding and software uninstallation

Published: July 25, 2019 - 1:16 PM
by skoizer
Thanks for your reply
I tried using ur but it doesn't work
When I try the command below, the program starts.

Code: Select all

run(ur'"c:\Program Files\Autodesk\DWG TrueView 2018 - Français (French)\Setup\fr-FR\Setup\Setup.exe")
I'm sure it's the command line, because if I run the program manually, it does a silent install
"c:\Program Files\Autodesk\DWG TrueView 2018 - Français (French)\Setup\fr-FR\Setup\Setup.exe" /P {28B89EEF-1028-040C-0100-CF3F3A09B77D} /R AOEM /language fr-FR /q