Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable build should set IsPortable in config #5758

Closed
vbjay opened this issue Nov 12, 2018 · 8 comments
Closed

Portable build should set IsPortable in config #5758

vbjay opened this issue Nov 12, 2018 · 8 comments
Milestone

Comments

@vbjay
Copy link
Contributor

vbjay commented Nov 12, 2018

Do you want to request a feature or report a bug?
bug
What is the current behavior?

The portable build doesn't alter GitExtensions.exe.config

<GitCommands.Properties.Settings>
      <!--Set this setting to True to store settings with the application, False to  store settings in user's application data path.-->
      <setting name="IsPortable" serializeAs="String">
        <value>False</value>
      </setting>
    </GitCommands.Properties.Settings>

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

This value should be True on a portable build.
Environment you encounter the issue:

  • Git Extensions 3.00.rc2
  • ef05b7c
  • Git 2.19.1.windows.1
  • Microsoft Windows NT 10.0.17763.0
  • .NET Framework 4.7.3190.0
  • DPI X:100.00% Y:100.00%

Did this work in previous version of GitExtensions (which)?

@vbjay
Copy link
Contributor Author

vbjay commented Nov 13, 2018

I have a solution. Just trying to get the MakePortable.cmd run the powershell

$doc= [xml](Get-Content .\GitExtensions\GitExtensions.exe.config)
$port=$doc.configuration.applicationSettings.'GitCommands.Properties.Settings'.setting|? {$_.name -eq 'IsPortable'}
$port.value="True"
$pth = Resolve-Path .\GitExtensions
$doc.Save([System.IO.Path]::Combine($pth,"GitExtensions.exe.config"))

@RussKie
Copy link
Member

RussKie commented Nov 13, 2018 via email

@vbjay
Copy link
Contributor Author

vbjay commented Nov 13, 2018

Look good?

image

@RussKie
Copy link
Member

RussKie commented Nov 13, 2018

I'd tweak it slightly

$path = Resolve-Path .\GitExtensions\GitExtensions.exe.config
[xml]$doc= Get-Content $path
$port=$doc.configuration.applicationSettings.'GitCommands.Properties.Settings'.setting | ?{ $_.name -eq 'IsPortable' } 
if ($port) {
    $port.value="True" 
    $doc.Save($path)
}

Writing in a browser without a PS to test

@vbjay
Copy link
Contributor Author

vbjay commented Nov 13, 2018

    .\BuildInstallers.cmd

    Write-Host ----------------------------------------------------------------------
    Write-Host Alter Config
    Write-Host ----------------------------------------------------------------------
    $pth = Resolve-Path ..\GitExtensions\bin\Release\GitExtensions.exe.config
    $doc= [xml](Get-Content $pth)
    $port=$doc.configuration.applicationSettings.'GitCommands.Properties.Settings'.setting|? {$_.name -eq 'IsPortable'}
    if($port){
        $port.value="True"
        $doc.Save($pth)
    }

    Write-Host ----------------------------------------------------------------------
    Write-Host Make Portable Archive
    Write-Host -------------------------------------------------------------------
    .\MakePortableArchive.cmd Release $newVersion-beta1

    if($port){
        Write-Host ----------------------------------------------------------------------
        Write-Host Restore Config
        Write-Host -------------------------------------------------------------------
        $port.value="False"
        doc.Save($pth)
   }

@RussKie
Copy link
Member

RussKie commented Nov 13, 2018

Do we care about the restoring the original flag? To me this is all a throwaway...

@vbjay
Copy link
Contributor Author

vbjay commented Nov 13, 2018

If someone builds for their personal use, we don't want the run in release to be portable. Only the actual portable build.

@vbjay
Copy link
Contributor Author

vbjay commented Nov 13, 2018

If they run MakePortable.cmd after build.cmd, this will not work. Why I was trying to make the cmd call the powershell script.

@RussKie RussKie added this to the 3.00 milestone Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants