How can I get NSIS to install and execute files from a temp directory?

前端 未结 3 541
囚心锁ツ
囚心锁ツ 2021-02-07 18:24

I\'m using the following NSIS script:

Name \"My app wrapper\"
Outfile \"MyAppSetup.exe\"
InstallDir $TEMP\\MyApp\\Install
Function .onInit
SetSilent silent
Funct         


        
相关标签:
3条回答
  • 2021-02-07 18:50

    This is another way to do it

    Function .onInit
    
        InitPluginsDir
            File /oname=$PLUGINSDIR\test.exe "test.exe"
    
    FunctionEnd
    
    Section "Exec file" SecFile
    
        nsExec::Exec $PLUGINSDIR\test.exe
    
    SectionEnd
    
    0 讨论(0)
  • 2021-02-07 19:05
    Section
    InitPluginsDir
    SetOutPath "$pluginsdir\MyApp\Install" ;It is better to put stuff in $pluginsdir, $temp is shared
    
    File installer.msi
    File setup.exe
    
    ExecWait '"$pluginsdir\MyApp\Install\setup.exe"' ;You should always use full paths and proper quotes
    
    SetOutPath $exedir ;Change current dir so $temp and $pluginsdir is not locked by our open handle
    SectionEnd
    
    0 讨论(0)
  • 2021-02-07 19:06

    I don't know if it would solve your problem but I would write :

    Exec $TEMP\MyApp\Instal\setup.exe
    

    Are you sure that $TEMP is pointing to C:/Temp? Did you check it?

    0 讨论(0)
提交回复
热议问题