Recent Posts

Pages: 1 2 [3] 4 5 6 7 8 ... 10
21
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.
22
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.
23
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....

24
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.
25
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.
26
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?
27
Plugins development / Re: New plugin: Premake5 exporter (premake5cb)
« Last post by cacb on July 24, 2021, 12:53:40 pm »
It sometimes possible to perform a "roundtrip" :

Code::Blocks workspace  ---(1)--> Premake5 script  ---(2)--> Code::Blocks workspace

(1) is obviously done using the Premake5 exporter plugin

(2) is done using a Premake5 plugin generating Code::Blocks workspaces :-)

To install and use (2)

cd ~
mkdir ./.premake
cd .premake
git clone  https://github.com/chris-be/premake-codeblocks  codeblocks


Using the https://github.com/arnholm/pm5example1 example, add the following to the pm5example1_premake5.lua file:

require "codeblocks"

Then run Premake5
premake5 --file=pm5example1_premake5.lua codeblocks

The result is a new set of Code::Blocks .workspace and .cbp files in a subfolder.
28
Help / Windows Codeblocks uninstall - Associations left over after uninstall
« Last post by AndrewCot on July 24, 2021, 12:09:19 pm »
On Windows when you uninstall Code::Blocks via the Windows uninstall process there are file associations left in the registry due to the code in the src\associations.cpp (Associations::DoSetAssociation function)  that are not removed on an uninstall... This is not very good IMHO.

You can use the following process to see the registry entries that have NOT been removed, assuming you have ccleaner (ccleaner slim is my preferred version)
1) Run ccleaner and clean the registry until no more registry entries can be cleaned.
2) Uninstall Code::Blocks
3) Rename/backup the Code::Blocks APPDATA directory (%APPDATA%\CodeBlocks)
4) Delete the Code::Blocks APPDATA directory (rmdir /q /s %APPDATA%\CodeBlocks)
5) Install Code::Blocks "codeblocks-20.03-setup.exe"
6) Run Code::Blocks and associate C/C++ to C::B
7) Exit Code::Blocks
5) Uninstall Code::Blocks
6) Run ccleaner and scan for registry entry issues. You should see a bunch of entries left over from C::B:

Should the NSIS script detect these registry entries and remove them or is there a better way of doing this?
29
Help / Windows Installer scripts - Query full or customise and inconsistencies
« Last post by AndrewCot on July 24, 2021, 03:36:52 am »
I have been working on the NSIS installation script this week and have created a working ISS script as there are some things that work better with one than the other.

The ISS script does a full install and this morning I started working on the install type (minimum, standard, full and custom) and the custom component options and found that the existing installer has a bunch of what I think are inconsistencies in that it:
    1) Installs all of the scripts, wizards and templates
    2) Installs the lexers based on the components based on the user selection

This sounds okay until you look and there are languages/scripts that span both 1) scripts and/or wizards and/or templates and also 2) lexers , SO this bring's up the question why does the installer not include the scripts and/or wizards and/or templates when you select/deselect the lexer that they potentially relate to.

A good example is fortran as follows:

Always installed:
     compiler_pgifortran.xml
     compilerGNUFortran.cpp
     fortran wizard


NSIS Script:
            Section "Fortran"
                SectionIn 1 4
                SetOutPath $INSTDIR${CB_LEXERS}
                SetOverwrite on
                File ${CB_BASE}${CB_LEXERS}\lexer_f77.sample
                File ${CB_BASE}${CB_LEXERS}\lexer_f77.xml
                File ${CB_BASE}${CB_LEXERS}\lexer_fortran.sample
                File ${CB_BASE}${CB_LEXERS}\lexer_fortran.xml
                WriteRegStr HKCU "${REGKEY}\Components" "Fortran" 1
            SectionEnd

    Section "Fortran Project plugin" SEC_FORTRANPROJECT
        SectionIn 1
        SetOutPath $INSTDIR${CB_SHARE_CB}
        SetOverwrite on
        File ${CB_BASE}${CB_SHARE_CB}\FortranProject.zip
        SetOutPath $INSTDIR${CB_PLUGINS}
        File ${CB_BASE}${CB_PLUGINS}\FortranProject.dll
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject
        File ${CB_BASE}${CB_IMAGES}\fortranproject\*.dem
        File ${CB_BASE}${CB_IMAGES}\fortranproject\*.f90
        File ${CB_BASE}${CB_IMAGES}\fortranproject\*.py
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\16x16
        File ${CB_BASE}${CB_IMAGES}\fortranproject\16x16\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\20x20
        File ${CB_BASE}${CB_IMAGES}\fortranproject\20x20\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\24x24
        File ${CB_BASE}${CB_IMAGES}\fortranproject\24x24\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\28x28
        File ${CB_BASE}${CB_IMAGES}\fortranproject\28x28\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\32x32
        File ${CB_BASE}${CB_IMAGES}\fortranproject\32x32\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\40x40
        File ${CB_BASE}${CB_IMAGES}\fortranproject\40x40\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\48x48
        File ${CB_BASE}${CB_IMAGES}\fortranproject\48x48\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\56x56
        File ${CB_BASE}${CB_IMAGES}\fortranproject\56x56\*.png
        SetOutPath $INSTDIR${CB_IMAGES}\fortranproject\64x64
        File ${CB_BASE}${CB_IMAGES}\fortranproject\64x64\*.png
        WriteRegStr HKCU "${REGKEY}\Components" "Fortran Project plugin" 1
    SectionEnd


If you get this far then this brings up the following questions:
a) Does anyone use the component selection?
b) Does anyone use the minimum, standard or full selection?
c) To make the installer a great deal simpler and easier to maintain/understand/read is it okay to remove the selection and component options and always do a full install?

NOTE: Full does not include MingW in the context of this post /thread.

30
Help / Re: PLS HELP
« Last post by sodev on July 23, 2021, 07:39:41 pm »
Looking at the signature of that dude and the other post he made, this looks like one of the smarter spam bots?
Pages: 1 2 [3] 4 5 6 7 8 ... 10