Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
Help / Re: Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by sodev on Yesterday at 07:27:38 pm »
@sodev The keys listed that I have a problem with are added by the CB exe and as such are in the HKCU.
And this is the problem, as regular user you can only access YOUR HKCU, but not the HKCU of OTHER users. For this you need to be root, enumerate all user accounts and check their HKCU. At least for NSIS this is not (easily) possible.
2
@sodev The keys listed that I have a problem with are added by the CB exe and as such are in the HKCU.

@cacb I have a "working" inno setup. It does a full install only and it is allot easier to implement the registry key removal code and after removed CCleaner does not find any registry issues (there are still fragments of CB in other registry entries that I need to check out). BTW I think I need to find a better registry checker program as searching the registry via regedit is slooowwwww.

The next step for me is to check the NSIS script registry removed code works the same way as the ISS pascal registry removal code and update it if there is any discrepancies.
3
Help / Re: Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by cacb on July 26, 2021, 09:08:52 pm »
I have mainly some experience using InnoSetup, and then I believe this is not a problem (I have done similar with InnoSetup in the past).  "The uninstall info root key will always be HKEY_CURRENT_USER, and the "common" forms of the Shell Folder constants are mapped to the "user" forms, even if administrative privileges are available"

Probably these things are features of the installer being used. Probably NSIS is different, I'll leave it there.
4
Plugins development / Re: New plugin: Premake5 exporter (premake5cb)
« Last post by cacb on July 26, 2021, 08:54:43 pm »
Premake5 exporter has been updated to better accommodate generating for several build systems at once. For example, you may want to generate both linux makefiles and Visual Studio solution files at the same time, but keep them separate. The only difference when generating these files is the Premake5 action specified on the command line (the file pm5example1_premake5.lua is generated by Premake5 exporter ):

Run premake5 to generate makefiles:
Code
m5example1$ premake5 --file=pm5example1_premake5.lua gmake2
Building configurations...
Running action 'gmake2'...
Generated build/gmake2/Makefile...
Generated build/gmake2/long/path/staticlib1/Makefile...
Generated build/gmake2/dynlib1/Makefile...
Generated build/gmake2/testconsole/Makefile...

Run premake5 to generate Visual Studio files
Code
pm5example1$ premake5 --file=pm5example1_premake5.lua vs2019
Building configurations...
Running action 'vs2019'...
Generated build/vs2019/pm5example1.sln...
Generated build/vs2019/long/path/staticlib1/staticlib1.vcxproj...
Generated build/vs2019/dynlib1/dynlib1.vcxproj...
Generated build/vs2019/testconsole/testconsole.vcxproj...

Generating for different build systems are now better organised in separate folders under the common 'build' root.
5
Help / Re: Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by sodev on July 26, 2021, 07:08:33 pm »
The problem is, the installer usually runs with root rights, so the U of HKCU is root. But IIRC Codeblocks sets these associations as the user it runs under, which usually is not root, so its U is another one. Even worse, it could have more than one value for U. This could only be avoided if Codeblocks sets these associations under HKLM, but for this it needs to elevate itself to root. This also has the effect that these associations are now system wide instead of user only.

If the installer establishes the associations, instead of Code::Blocks itself (or maybe in addition to), then an uninstall will remove and tidy up the associations.

Not by itself, you have to add code to remove these associations yourself 8). Still, the same issues apply like mentioned above.
6
Help / Re: Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by Krice on July 26, 2021, 06:13:37 pm »
Is this a big problem? I think some programs do this and Windows also has now user directories (etc.) where programs leave their files, which I think is annoying.
7
The NSIS script below removes some HKCU\SOFTWARE\Classes sub entries, but not the entries listed below,

Not Removed Associations:
   HKCU\SOFTWARE\Classes\.cbp
   HKCU\SOFTWARE\Classes\.cc
   HKCU\SOFTWARE\Classes\.tcc
   HKCU\SOFTWARE\Classes\.workspace
   HKCU\SOFTWARE\Classes\CodeBlocks.cpp
   HKCU\SOFTWARE\Classes\CodeBlocks.hpp
   HKCU\SOFTWARE\Classes\CodeBlocks.tpp

NSIS Script snippet that includes NSIS special build logging:
Code
    # Start Unregister CodeBlocks associated files - see FileAssocation.cpp
    # or check out the registry "Computer\HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.*" entries.
   
    ${If} ${RunningX64}
        LogText "SetRegView 64"
        SetRegView 64
        StrCpy $0 0 ; Registry key index
        ; Length of "CodeBlocks" = 10
        enumunkey64:
            EnumRegKey $1 HKCU "SOFTWARE\Classes" $0
            ;LogText "Read HKCU\SOFTWARE\Classes\$1"
            IntOp $0 $0 + 1
            StrCmp $1 "" done64
            StrCpy $2 $1 10  0
            ; LogText "Read 0 = $0 , 1 = $1 , 2 = $2"
            StrCmp $2 "CodeBlocks" 0 enumunkey64
            StrLen $3 $1
            IntOp $3 $3 - 10    ; Includes .
            StrCpy $4 $1 $3 10  ; Includes .
            LogText "L2755 1 = $1 , 2 = $2 , 3 = $3 , 4 = $4"
            StrCmp $4 "" enumunkey64
            ReadRegStr $5 HKCU "SOFTWARE\Classes\$4" ""
            LogText "L2758 1 = $1 , 2 = $2 , 5 = $5"
            StrCmp $5 $1 0 DelCodeBlocksEntry64   ; If no file extension classes found then goto DelCodeBlocksEntry
            StrCmp $5 $2 0 DelCodeBlocksEntry64   ; If file extension classes is not for codeblocks entry goto DelCodeBlocksEntry
            LogText "TBA L2761 Found : 'SOFTWARE\Classes\$1'"
            LogText "ReadRegStr 'SOFTWARE\Classes\$4' returned $5"

            LogText "DeleteRegValue HKCU 'SOFTWARE\Classes\$4' ''"
            DeleteRegValue HKCU "SOFTWARE\Classes\$4" ""    ; Delete default as it is codeblocks
            LogText "DeleteRegKey /IfEmpty HKCU 'SOFTWARE\Classes\$4'"
            DeleteRegKey /IfEmpty HKCU "SOFTWARE\Classes\$4"
        DelCodeBlocksEntry64:
            DeleteRegKey HKCU "SOFTWARE\Classes\$1"
            Goto enumunkey64

        done64:   
        # Finish Unregister CodeBlocks associated files - see FileAssocation.cpp
        SetRegView 32
        LogText "SetRegView 32"
    ${EndIf}
       
    StrCpy $0 0 ; Registry key index
    ; Length of "CodeBlocks" = 10
    enumunkey:
        EnumRegKey $1 HKCU "SOFTWARE\Classes" $0
        ;LogText "Read HKCU\SOFTWARE\Classes\$1"
        IntOp $0 $0 + 1
        StrCmp $1 "" done
        StrCpy $2 $1 10  0
        ;LogText "Read 0 = $0 , 1 = $1 , 2 = $2"
        StrCmp $2 "CodeBlocks" 0 enumunkey
        StrLen $3 $1
        IntOp $3 $3 - 10    ; Includes .
        StrCpy $4 $1 $3 10  ; Includes .
        LogText "L2791 1 = $1 , 2 = $2 , 3 = $3 , 4 = $4"
        StrCmp $4 "" enumunkey
        ReadRegStr $5 HKCU "SOFTWARE\Classes\$4" ""
        LogText "L2794 1 = $1 , 2 = $2 , 5 = $5"
        StrCmp $5 $1 0 DelCodeBlocksEntry   ; If no file extension classes found then goto DelCodeBlocksEntry
        StrCmp $5 $2 0 DelCodeBlocksEntry   ; If file extension classes is not for codeblocks entry goto DelCodeBlocksEntry
        LogText "TBA L2797 Found : 'SOFTWARE\Classes\$1'"
        LogText "ReadRegStr 'SOFTWARE\Classes\$4' returned $5"

        LogText "DeleteRegValue HKCU 'SOFTWARE\Classes\$4' ''"
        DeleteRegValue HKCU "SOFTWARE\Classes\$4" ""    ; Delete default as it is codeblocks
        LogText "DeleteRegKey HKCU 'SOFTWARE\Classes\$4'"
        DeleteRegKey HKCU "SOFTWARE\Classes\$4"
    DelCodeBlocksEntry:
        DeleteRegKey HKCU "SOFTWARE\Classes\$1"
        Goto enumunkey


I have used the MS Process Monitor to see if there is any differences between the HKCU\SOFTWARE\Classes\CodeBlocks.tpp and HKCU\SOFTWARE\Classes\CodeBlocks.cbp access when running Code::Block for the first time when I associate CB with the C/C++ files and I could not see any differences, but I must have missed something as the CodeBlocks.cbp  is removed and the CodeBlocks.tpp is not....

8
Help / Re: Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by cacb on July 25, 2021, 08:49:21 am »
If the installer establishes the associations, instead of Code::Blocks itself (or maybe in addition to), then an uninstall will remove and tidy up the associations.
9
Quote
Windows is multiuser system. How are we supposed to do this in this environment?

If I knew this then I would not have asked.
10
Should the NSIS script detect these registry entries and remove them or is there a better way of doing this?
Windows is multiuser system. How are we supposed to do this in this environment?
Pages: [1] 2 3 4 5 6 ... 10